Skip to content

Fix golangci-lint CI: upgrade to v2 + resolve all findings - #67

Merged
YASSERRMD merged 2 commits into
mainfrom
fix/golangci-v2-and-lint-issues
May 29, 2026
Merged

Fix golangci-lint CI: upgrade to v2 + resolve all findings#67
YASSERRMD merged 2 commits into
mainfrom
fix/golangci-v2-and-lint-issues

Conversation

@YASSERRMD

Copy link
Copy Markdown
Owner

Summary

The lint job failed with "the Go language version (go1.23) used to build golangci-lint is lower than the targeted Go version (1.25.0)". golangci-lint v1.61.0 cannot analyze a module that targets Go 1.25.

  • Upgrade golangci-lint to v2.12.2 via golangci-lint-action@v8, and migrate .golangci.yml to the v2 config format.
  • With the linter now actually running (it never could before), resolve all 53 findings it surfaced across phase 36-55 and pre-existing code:
    • removed/derived unused declarations (canonical, listing, validateURL, ensureFmt; exported RunParallel)
    • checked previously-ignored session.Wait() returns in the 12 MCP server mains
    • renamed Run_ field to RunFn (var-naming) and updated call sites
    • renamed unused params to _ across several funcs
    • replaced hand-rolled string/int helpers with stdlib (strings.ReplaceAll, fmt.Sprintf)
    • stored pooled buffers by pointer (SA6002); escaped the zero-width space literal (ST1018); merged the connected-components closure decl
    • documented gosec excludes for genuine false-positives (G101 DSN default, G118 detached verification ctx, G404 non-crypto sampling, G705 html/template auto-escape, G124 locale cookie on plain-HTTP .onion); disabled noisy govet shadow and revive redefines-builtin-id

Test plan

  • golangci-lint run --timeout=5m -> 0 issues
  • gofmt -l . -> clean
  • go build ./... and go test ./... -> all pass

@YASSERRMD
YASSERRMD merged commit 97bf1d7 into main May 29, 2026
6 checks passed
@YASSERRMD
YASSERRMD deleted the fix/golangci-v2-and-lint-issues branch May 29, 2026 09:35
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