From 54367b32837e30dc3c4fe08584552812e959500d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 4 Aug 2025 09:14:13 +0200 Subject: [PATCH] cli-plugins/manager: un-export "Candidate" interface It is for internal use for mocking purposes, and is not part of any public interface / signature. Signed-off-by: Sebastiaan van Stijn --- cli-plugins/manager/candidate.go | 6 ------ cli-plugins/manager/plugin.go | 8 +++++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cli-plugins/manager/candidate.go b/cli-plugins/manager/candidate.go index d809926cf6..a4253968dc 100644 --- a/cli-plugins/manager/candidate.go +++ b/cli-plugins/manager/candidate.go @@ -6,12 +6,6 @@ import ( "github.com/docker/cli/cli-plugins/metadata" ) -// Candidate represents a possible plugin candidate, for mocking purposes -type Candidate interface { - Path() string - Metadata() ([]byte, error) -} - type candidate struct { path string } diff --git a/cli-plugins/manager/plugin.go b/cli-plugins/manager/plugin.go index fa846452b5..ed4dac54e6 100644 --- a/cli-plugins/manager/plugin.go +++ b/cli-plugins/manager/plugin.go @@ -31,12 +31,18 @@ type Plugin struct { ShadowedPaths []string `json:",omitempty"` } +// pluginCandidate represents a possible plugin candidate, for mocking purposes. +type pluginCandidate interface { + Path() string + Metadata() ([]byte, error) +} + // newPlugin determines if the given candidate is valid and returns a // Plugin. If the candidate fails one of the tests then `Plugin.Err` // is set, and is always a `pluginError`, but the `Plugin` is still // returned with no error. An error is only returned due to a // non-recoverable error. -func newPlugin(c Candidate, cmds []*cobra.Command) (Plugin, error) { +func newPlugin(c pluginCandidate, cmds []*cobra.Command) (Plugin, error) { path := c.Path() if path == "" { return Plugin{}, errors.New("plugin candidate path cannot be empty")