From 3c78ac2aad565bdbd2ec74fb40133be355ba575b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 29 Sep 2025 13:05:08 +0200 Subject: [PATCH] cli/config/memorystore: remove unused IsErrValueNotFound This utility was added in 9b83d5bbf9d6d7f8abf485609e99bc0cd3300dc0, but was never used. Remove the utility, and rewrite the error returned to implement the errdefs.NotFound interface, so that it can be detected using the errdefs.IsNotFound() utility if needed. Signed-off-by: Sebastiaan van Stijn --- cli/config/memorystore/store.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cli/config/memorystore/store.go b/cli/config/memorystore/store.go index 199083464..267e1e343 100644 --- a/cli/config/memorystore/store.go +++ b/cli/config/memorystore/store.go @@ -3,7 +3,6 @@ package memorystore import ( - "errors" "fmt" "maps" "os" @@ -13,12 +12,17 @@ import ( "github.com/docker/cli/cli/config/types" ) -var errValueNotFound = errors.New("value not found") +// notFoundErr is the error returned when a plugin could not be found. +type notFoundErr string -func IsErrValueNotFound(err error) bool { - return errors.Is(err, errValueNotFound) +func (notFoundErr) NotFound() {} + +func (e notFoundErr) Error() string { + return string(e) } +var errValueNotFound notFoundErr = "value not found" + type Config struct { lock sync.RWMutex memoryCredentials map[string]types.AuthConfig