🐛 fix(ci): bump golangci-lint to v2.13.1 for Go 1.27 support - #86
Merged
Conversation
`verify` was red on every PR — including a six-file Markdown diff with zero Go bytes — because `go-version: stable` rolled Go 1.26 -> 1.27.0 while GOLANGCI_LINT_VERSION sat at v2.12.2. golangci-lint typechecks the standard library with the go/types it was COMPILED with, so a binary built by go1.26.x cannot read the 1.27 stdlib; the failing path was inside the Go toolchain's own source tree, which no author change could fix. v2.13.0 carries upstream's "go1.27 support" commit. Reproduced against a local Go 1.27.0 SDK: v2.12.2 panics in goanalysis/runner_loadingpackage.go, the official v2.13.1 asset reports 0 issues, and `config verify` passes, so the v2 config schema needs no migration. v2.13.1 is also 0 issues against Go 1.26.6 and via the `go install` path release-exitgate uses. Single-sourced at workflow scope (D-128), so this one line fixes both the action in `verify` and the `go install` in `release-exitgate`. `stable` is kept: pinning the toolchain instead would leave the class of bug live and trade a loud recurrence for silent drift onto an unsupported Go.
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.
What
Bumps
GOLANGCI_LINT_VERSIONfromv2.12.2tov2.13.1in.github/workflows/verify.yaml. Oneenv:line, plus a comment recording the failure signature and the diagnosis heuristic. Zero Go bytes changed.Why
verifywas red on every PR — including six-file Markdown diffs with no Go in them — with:The failing path is inside the Go toolchain's own source tree, so no author change can fix it and a re-run cannot clear it.
Mechanism: golangci-lint typechecks the standard library with the
go/typesit was compiled with, not thegoonPATH. GitHub'sgo-version: stablerolled Go 1.26 → 1.27.0 between the last greenmainrun and today. Thev2.12.2release binary is built with go1.26.4 and cannot read the Go 1.27.0 stdlib.v2.13.1is built with go1.27.0 and can.Diagnosis heuristic worth keeping: golangci-lint's own
go.modcarries the comment "the minimum Go version must always be latest-1", so itsgodirective is a machine-readable "supports Go 1.N+1" signal — v2.12.2 saysgo 1.25.0(supports ≤ 1.26), v2.13.1 saysgo 1.26.0(supports ≤ 1.27).Scope of the one line
The pin is single-sourced at workflow scope (D-128), so this one line fixes both exposed sites at once: the
golangci-lint-actionin theverifyjob and thego install golangci-lint@$GOLANGCI_LINT_VERSIONinrelease-exitgate.go-version: stableis deliberately kept — pinning Go instead would need two pins, leave the bug class live, and trade a loud recurrence for silent drift onto an unsupported Go in a repo running govulncheck + cosign + SLSA + Scorecard.Evidence
Reproduced locally rather than reasoned:
PATH,GOTOOLCHAIN=local, whole tree: v2.12.2 → panic ingo/types.(*Checker).Files, exit 2; v2.13.1 → 0 issues, exit 0.golangci-lint config verify→ exit 0, so.golangci.ymlneeds no schema migration.go install …@v2.13.1under Go 1.27.0 → 0 issues (therelease-exitgatepath, which ispull_request-skipped and therefore never exercised by a PR).Zero new lint findings tree-wide under both Go 1.26.6 and Go 1.27.0.
Verification
This PR's own
verifyrun is the test of the fix:pull_requestruns use the workflow from the PR merge ref, so a greenverifyhere is the reproduction of the remedy.Local gate matrix:
task checkgreen,task changelog-verifygreen.Residual risk
When
stablerolls to Go 1.28, v2.13.1 will break identically. The repo finds out loudly (every PR reds, including zero-Go diffs) and the fix is again one env line — the signature is recorded in the workflow comment. Nothing detects it earlier: dependabot'sgithub-actionsecosystem updatesuses:refs, notenv:literals. Tracked asCI-TOOLCHAIN-F01in the backlog.Decision row: D-158.