fix(cmd/csvauth): use errors.Is(err, ErrInQuestion) correctly

This commit is contained in:
AJ ONeal 2026-02-21 02:52:41 -07:00
parent b4886aa710
commit 6e0c91feb4
No known key found for this signature in database

View File

@ -320,7 +320,7 @@ func handleSet(args []string, aesKey []byte, csvFile csvauth.NamedReadCloser) {
var exists bool var exists bool
if len(*purpose) > 0 && *purpose != "login" { if len(*purpose) > 0 && *purpose != "login" {
if _, err := auth.LoadServiceAccount(*purpose); err != nil { if _, err := auth.LoadServiceAccount(*purpose); err != nil {
if !errors.Is(csvauth.ErrNotFound, err) { if !errors.Is(err, csvauth.ErrNotFound) {
fmt.Fprintf(os.Stderr, "could not load %s: %v\n", *purpose, err) fmt.Fprintf(os.Stderr, "could not load %s: %v\n", *purpose, err)
} }
} else { } else {
@ -330,7 +330,7 @@ func handleSet(args []string, aesKey []byte, csvFile csvauth.NamedReadCloser) {
_ = auth.CacheServiceAccount(*c) _ = auth.CacheServiceAccount(*c)
} else { } else {
if _, err := auth.LoadCredential(name); err != nil { if _, err := auth.LoadCredential(name); err != nil {
if !errors.Is(csvauth.ErrNotFound, err) { if !errors.Is(err, csvauth.ErrNotFound) {
fmt.Fprintf(os.Stderr, "could not load %s: %v\n", name, err) fmt.Fprintf(os.Stderr, "could not load %s: %v\n", name, err)
} }
} else { } else {