Following the convo in #2 this PR suggests:
- Fixes to all
golangci-lintissues - Adding
golangci-lintto the CI to assure consistency moving forward
Following the convo in #2 this PR suggests:
golangci-lint issuesgolangci-lint to the CI to assure consistency moving forwardCloses #4
Sure thing! It is a lot of changes : ) Happy to follow up wherever needed.
I appreciate the work, but I think this would have been better done in chunks. I'm trying to lint some of the obvious ones you found but I don't think I can merge this PR as is.
Currently there are a few bugs from the refactor: Logic Inversion in Version Check - cmd/credential-helper/main.go:714-721
shouldUpdate, err := isNewerVersion(versionInfo.Latest, version)
if err != nil {
return err
}
if shouldUpdate { // ← BUG: true means newer IS available
fmt.Printf("You're already running the latest version (%s)\n", version)
return nil
}
WriteHeader Order Bug - pkg/appview/handlers/images.go:103-107
w.Header().Set("Content-Type", "application/json")
resp := map[string]any{...}
if err := json.NewEncoder(w).Encode(resp); err != nil {
slog.Error("failed to write response", "error", err)
w.WriteHeader(http.StatusInternalServerError)
}
w.WriteHeader(http.StatusConflict) // ← BUG: ALWAYS called, after body!
pkg/hold/oci/xrpc_test.go imports slog, which shouldn't be added to test files.
There are more issues, I wish i could inline-comment here like on github.
I think this would have been better done in chunks.
That is reasonable! Closed this one, I'll get another approach started in the next PR. Let's get it done in a non-disruptive way ; )
Thanks. this will take a bit to comb through.