Conversation
## Changes
Upgrades the pinned golangci-lint version via `tools/go.{mod,sum}`.
The bump pulls in newer staticcheck and perfsprint rules that surface
28 pre-existing issues. They are resolved in this same PR so CI goes
green:
- 9 × `perfsprint concat-loop` — hand-rewritten using `strings.Builder`
(or `[]byte` accumulators in test code) with sensible variable names,
instead of the auto-fix's mechanical `<name>Sb<lineno>` output.
- 17 × `staticcheck QF1012` (`WriteString(fmt.Sprintf(...))` →
`fmt.Fprintf(&sb, ...)`) — applied via `golangci-lint run --fix`.
- 2 × intentional fixture sites silenced with `//nolint:staticcheck`:
a `parser.ParseDir` import-only scan (SA1019, deprecated in Go 1.25)
and a deliberately malformed `json:"-,omitempty"` tag (SA5008) used
to exercise structwalk tag handling.
## Why
The main motivation for the bump is access to the `modernize` linter,
which wraps gopls's modernize analyzer suite (`stringsbuilder`,
`reflecttypefor`, `omitzero`, `mapsloop`, etc.) and became available in
golangci-lint v2.6.0. It's the closest in-tree equivalent to Go 1.26's
`go fix ./...` modernizers while we're still on the Go 1.25 toolchain.
- golangci-lint `modernize` linter:
https://golangci-lint.run/usage/linters/#modernize
- Upstream analyzer suite:
https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize
Enabling `modernize` and applying its rewrites is intentionally NOT
part of this PR — it will ship as a follow-up so this change stays
local and small (just the bump + the lint-rule fallout it forces).
Co-authored-by: Isaac
denik
approved these changes
Apr 22, 2026
simonfaltum
approved these changes
Apr 22, 2026
janniklasrose
approved these changes
Apr 22, 2026
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.
Changes
Upgrades the pinned golangci-lint version via
tools/go.{mod,sum}.The bump pulls in newer
staticcheckandperfsprintrules that surface 28 pre-existing issues. They are resolved in this same PR so CI goes green:perfsprint concat-loop— hand-rewritten usingstrings.Builder(or[]byteaccumulators in test code) with sensible variable names, instead of the auto-fix's mechanical<name>Sb<lineno>output.staticcheck QF1012(WriteString(fmt.Sprintf(...))→fmt.Fprintf(&sb, ...)) — applied viagolangci-lint run --fix.//nolint:staticcheck: aparser.ParseDirimport-only scan (SA1019, deprecated in Go 1.25) and a deliberately malformedjson:"-,omitempty"tag (SA5008) used to exercise structwalk tag handling.Why
The main motivation for the bump is access to the
modernizelinter, which wraps gopls's modernize analyzer suite (stringsbuilder,reflecttypefor,omitzero,mapsloop, etc.) and became available in golangci-lint v2.6.0. It's the closest in-tree equivalent to Go 1.26'sgo fix ./...modernizers while we're still on the Go 1.25 toolchain.modernizelinter: https://golangci-lint.run/usage/linters/#modernizeEnabling
modernizeand applying its rewrites is intentionally not part of this PR — it will ship as a follow-up so this change stays local and small (just the bump + the lint-rule fallout it forces).Test plan
make build— passesmake lint/./tools/golangci-lint run ./...— 0 issuesgo teston all touched packages — passingThis pull request and its description were written by Isaac.