Skip to content

Commit a3ffb8a

Browse files
committed
cli/config/memorystore: remove unused IsErrValueNotFound
This utility was added in 9b83d5b, 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 <[email protected]> (cherry picked from commit 3c78ac2) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 394991e commit a3ffb8a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cli/config/memorystore/store.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package memorystore
44

55
import (
6-
"errors"
76
"fmt"
87
"maps"
98
"os"
@@ -13,12 +12,17 @@ import (
1312
"github.com/docker/cli/cli/config/types"
1413
)
1514

16-
var errValueNotFound = errors.New("value not found")
15+
// notFoundErr is the error returned when a plugin could not be found.
16+
type notFoundErr string
1717

18-
func IsErrValueNotFound(err error) bool {
19-
return errors.Is(err, errValueNotFound)
18+
func (notFoundErr) NotFound() {}
19+
20+
func (e notFoundErr) Error() string {
21+
return string(e)
2022
}
2123

24+
var errValueNotFound notFoundErr = "value not found"
25+
2226
type Config struct {
2327
lock sync.RWMutex
2428
memoryCredentials map[string]types.AuthConfig

0 commit comments

Comments
 (0)