Repository navigation
ci(lint): adopt golangci-lint v2.14.0 tooling and strict lint config - #93
Merged
Merged
Conversation
- Add .golangci.yml based on the signet strict configuration with module-specific gci prefix - Add Makefile with lint, fmt, test, coverage and mod targets - Pin golangci-lint v2.14.0 via go.tools.mod with tool directive - Replace golangci-lint-action with make install-tools lint in CI workflow - Apply automated lint fixes: modernize, usestdlibvars, perfsprint, testifylint - Keep public API names unchanged via nolint directives for backward compatibility - Replace os.MkdirTemp with t.TempDir in tests - Clean up dead code and unused imports flagged by staticcheck and govet 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Code <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The pinned tooling, CI integration, configuration, and behavior-preserving cleanups are consistent and complete.
Review effort: Balanced
Findings: None
What changed in this PR
Adopts project-pinned golangci-lint v2.14.0 tooling, consistent local/CI lint commands, and lint-driven Go modernization without API changes.
Changes:
- Adds pinned tooling, Make targets, and strict lint/format configuration.
- Updates CI to use the project-managed linter.
- Applies behavior-preserving source and test modernizations.
| File | Description |
|---|---|
.golangci.yml |
Configures strict linting and formatting. |
.github/workflows/go.yml |
Runs the pinned linter through Make. |
Makefile |
Adds development and CI targets. |
go.tools.mod |
Pins golangci-lint and tool dependencies. |
go.tools.sum |
Locks tool dependency checksums. |
writer.go |
Modernizes header copying. |
timeout.go |
Modernizes types and header copying. |
writer_test.go |
Applies safer assertions and modern syntax. |
timeout_test.go |
Modernizes requests, assertions, and goroutines. |
buffer_pool_test.go |
Modernizes loops and assertions. |
_example/example01/main.go |
Applies configured import grouping. |
_example/example02/main.go |
Applies configured import grouping. |
_example/example03/main.go |
Applies configured import grouping. |
_example/example04/main.go |
Applies configured import grouping. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopt project-managed golangci-lint tooling (same approach as go-signet/signet) across build, lint config, and CI:
flowchart LR A[go.tools.mod<br/>pin golangci-lint v2.14.0] --> B[Makefile<br/>make lint / make fmt] B --> C[.golangci.yml<br/>strict v2 config] C --> D[GitHub Actions<br/>make install-tools lint] D --> E[Code fixes<br/>0 lint issues]Additions
.golangci.yml— strict golangci-lint v2 configuration (bidichk, gocritic, modernize, revive, testifylint, perfsprint, staticcheck, etc.) with module-specificgciimport orderingMakefile—lint,fmt,test,coverage,mod-download/tidy/verify,install-tools,helptargetsgo.tools.mod/go.tools.sum— pin golangci-lint v2.14.0 via Gotooldirective, executed withgo tool -modfile=go.tools.modCI changes
golangci/golangci-lint-actionwithmake install-tools lintso local and CI use the exact same pinned versionCode fixes (all lint issues resolved: 0 issues)
modernize(interface{} → any, range over int, maps.Copy),usestdlibvars(http.MethodGet),perfsprint,testifylint(assert → require),usetesting(os.MkdirTemp → t.TempDir)//nolintdirectives with explanations for backward compatibilityAI Authorship Disclosure
🤖 This change was prepared with AI assistance. Generated with Claude Code.
Change Classification
ci(tooling/CI) +style/refactor(lint fixes)Checklist
make lintpasses with 0 issues