Skip to content

fix: resolve golangci-lint v2 issues#59

Merged
wolfeidau merged 1 commit into
mainfrom
fix/golangci-lint-v2-nolints
May 15, 2026
Merged

fix: resolve golangci-lint v2 issues#59
wolfeidau merged 1 commit into
mainfrom
fix/golangci-lint-v2-nolints

Conversation

@wolfeidau
Copy link
Copy Markdown
Member

@wolfeidau wolfeidau commented May 15, 2026

  • 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()

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread protocol/git/index.go
var cached CachedPack
if err := idx.packIndex.GetJSON(ctx, cacheKey, &cached); err != nil {
if err == metadb.ErrNotFound {
if errors.Is(err, metadb.ErrNotFound) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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()
@wolfeidau wolfeidau force-pushed the fix/golangci-lint-v2-nolints branch from f2a75f7 to 3b98aed Compare May 15, 2026 21:58
@wolfeidau wolfeidau merged commit 0b87601 into main May 15, 2026
3 checks passed
@wolfeidau wolfeidau deleted the fix/golangci-lint-v2-nolints branch May 15, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant