Skip to content

ci: adopt golangci-lint v2.12.1 and fix goconst findings#101

Merged
ChrisJBurns merged 2 commits intomainfrom
fix/pin-golangci-lint-version
May 3, 2026
Merged

ci: adopt golangci-lint v2.12.1 and fix goconst findings#101
ChrisJBurns merged 2 commits intomainfrom
fix/pin-golangci-lint-version

Conversation

@ChrisJBurns
Copy link
Copy Markdown
Collaborator

@ChrisJBurns ChrisJBurns commented May 3, 2026

Summary

  • Pin golangci-lint to v2.12.1 in .github/workflows/lint.yml. The action was unpinned and auto-installing the latest binary, which broke main when v2.12.1 shipped with stricter goconst defaults.
  • Fix the production-code goconst findings in cmd/yardstick-client/main.go by extracting transport name constants ("stdio", "sse", "streamable-http") and a default address constant ("localhost").
  • Exclude goconst from (.+)_test\.go in .golangci.yml. Test fixtures legitimately repeat literals like "hello" and "test123"; forcing constants there adds noise without value, and matches the existing test-file exclusions for lll, gocyclo, errcheck, dupl, gosec, paralleltest.

Verified locally with golangci-lint v2.12.1: 0 issues.

Test plan

  • Linting workflow passes on this PR
  • Action logs show Installing golangci-lint binary v2.12.1

🤖 Generated with Claude Code

ChrisJBurns and others added 2 commits May 3, 2026 16:51
The lint workflow uses golangci-lint-action without a pinned version,
which auto-installed v2.12.1 and broke CI on main due to stricter
goconst defaults. Pin to v2.11.4 (the last known-good version) to
restore green builds while we evaluate the new findings.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Pin golangci-lint to v2.12.1 (was unpinned, breaking CI when v2.12.1
  shipped with stricter goconst defaults).
- Extract transport ("stdio", "sse", "streamable-http") and default
  address ("localhost") constants in cmd/yardstick-client/main.go.
- Exclude goconst from test files in .golangci.yml — test fixtures
  legitimately repeat literals like "hello" and "test123".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ChrisJBurns ChrisJBurns changed the title ci: pin golangci-lint to v2.11.4 ci: adopt golangci-lint v2.12.1 and fix goconst findings May 3, 2026
@ChrisJBurns ChrisJBurns merged commit 57cad68 into main May 3, 2026
5 checks passed
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