Fix errcheck lint failures in runList
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

golangci-lint (errcheck) in CI flagged the fmt.Fprintf calls in vctl's
runList as unchecked return values — writes to an arbitrary io.Writer are
not on errcheck's default exclude list (unlike os.Stdout/os.Stderr).

- discard the fmt.Fprintf return values in runList with '_, _ =', matching
  the existing convention used elsewhere in the tree

Claude-Session: https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv
This commit is contained in:
2026-07-26 23:49:13 +10:00
parent 123faf8bbf
commit bffbd45204
+3 -3
View File
@@ -241,13 +241,13 @@ func runList(w io.Writer) error {
}
names := cfg.ContextNames()
if len(names) == 0 {
fmt.Fprintf(w, "no contexts configured in %s\n", cfg.Path())
_, _ = fmt.Fprintf(w, "no contexts configured in %s\n", cfg.Path())
return nil
}
for _, name := range names {
rc, err := cfg.Resolve(name)
if err != nil {
fmt.Fprintf(w, "%-24s %v\n", name, err)
_, _ = fmt.Fprintf(w, "%-24s %v\n", name, err)
continue
}
status := "no token"
@@ -263,7 +263,7 @@ func runList(w io.Writer) error {
status = "token cached"
}
}
fmt.Fprintf(w, "%-24s %-40s %s\n", name, rc.Address, status)
_, _ = fmt.Fprintf(w, "%-24s %-40s %s\n", name, rc.Address, status)
}
return nil
}