From b1f2c1dc060370c54e73d04f859f1107d8112ff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Thu, 1 Oct 2026 19:01:36 +0200 Subject: [PATCH] cli-plugins/metadata: Add Features for optional plugin contracts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plugins had no generic way to declare support for optional CLI contracts, so each one would need its own top-level metadata field. Add Features, keyed by feature name. Values are arbitrary JSON so a feature can carry more than a boolean. Signed-off-by: Paweł Gronowski --- cli-plugins/metadata/metadata.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli-plugins/metadata/metadata.go b/cli-plugins/metadata/metadata.go index 7061486a70..c35a5ad028 100644 --- a/cli-plugins/metadata/metadata.go +++ b/cli-plugins/metadata/metadata.go @@ -1,3 +1,6 @@ +// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: +//go:build go1.26 + package metadata const ( @@ -35,4 +38,7 @@ type Metadata struct { URL string `json:",omitempty"` // Hidden hides the plugin in completion and help message output. Hidden bool `json:",omitempty"` + // Features declares optional contracts supported by the plugin, keyed by + // feature name. + Features map[string]any `json:",omitempty"` }