fix: resolve golangci-lint v2 issues#59
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f2a75f7075
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| var cached CachedPack | ||
| if err := idx.packIndex.GetJSON(ctx, cacheKey, &cached); err != nil { | ||
| if err == metadb.ErrNotFound { | ||
| if errors.Is(err, metadb.ErrNotFound) { |
There was a problem hiding this comment.
Import errors before using errors.Is
This new errors.Is call is added in a package that does not import the standard-library errors package, so any build or test that includes this package fails with undefined: errors. The same missing import is present in the new errors.Is usages in protocol/maven/index.go, protocol/npm/index.go, protocol/oci/upstream.go, and protocol/pypi/index.go, so add the import in each touched package.
Useful? React with 👍 / 👎.
- Add //nolint:gosec annotations for false positives in proxy handlers (G704 SSRF, G705 XSS, G710 redirect, G117 secret pattern, G118 background context, G115 int overflow) — all are intentional proxy/test behaviours - Migrate err == sentinel comparisons to errors.Is() across index/gc/handler files - Replace string HTTP method literals with http.MethodGet/Put/etc. constants - Pass request context into logPktLineSummary instead of context.Background()
f2a75f7 to
3b98aed
Compare
Uh oh!
There was an error while loading. Please reload this page.