ci: bump golangci-lint to v2.13 for Go 1.27 - #508
Merged
Conversation
golangci-lint v2.7 is built with an older Go and cannot read Go 1.27's
export data:
export data version 4 is greater than maximum supported version 2
Now that `stable` resolves to 1.27, every stdlib import fails to resolve and
the run collapses into a typecheck cascade — including an `errors.go:44:1:
missing return` for a function whose last statement is `panic(...)`. The Lint
job is red on unrelated PRs as a result.
v2.13.0 added Go 1.27 support and v2.13.2 is built with go1.27.0.
The bump also turns on govet's new `inline` analyzer, which suggests
`reflect.Pointer` over `reflect.Ptr` in three places. `reflect.Pointer` needs
Go 1.18 and this module still builds and tests on Go 1.12, so the analyzer is
disabled rather than the call sites changed. Worth revisiting whenever the
floor moves past 1.18.
Verified with golangci-lint 2.13.2: `config verify` and `run` both exit 0,
0 issues; `go test -race ./...` passes.
Author
|
Happy to help. Ping me if the linter flags anything new once it's running on v2.13. |
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.
Taking up @tomasaschan's "PR welcome" from #500.
The problem
stablenow resolves to Go 1.27, and golangci-lint v2.7 is built with an older Go, so it cannot read 1.27's export data:Every stdlib import then fails to resolve and the run collapses into a typecheck cascade — including
errors.go:44:1: missing returnfor a function whose last statement ispanic(...). Nothing in the module is actually wrong; theTestjobs stay green across all six matrix entries whileLintgoes red, which makes unrelated PRs look broken.The change
v2.7→v2.13. v2.13.0 added Go 1.27 support (go1.27 support golangci/golangci-lint#6642) and v2.13.2 is built withgo1.27.0.inlineanalyzer, which flagsreflect.Ptringolangflag.goandtext.go(3 sites) in favour ofreflect.Pointer.reflect.Pointerlanded in Go 1.18 andgo.modstill declaresgo 1.12— which CI genuinely exercises — so I disabled the analyzer instead of touching the call sites. Worth reverting whenever the floor moves past 1.18; I left a comment saying so.I kept this to the version bump. #451 already proposes restructuring the matrix, and I did not want to collide with it.
Verification
Local, golangci-lint 2.13.2:
golangci-lint config verify→ exit 0golangci-lint run→ exit 0,0 issues(on the same tree, v2.13 without the govet change reports the 3reflect.Ptrfindings)go test -race ./...→ okI could not reproduce the original failure locally — it needs a Go 1.27 toolchain, which is exactly the condition CI is now in — so the export-data diagnosis comes from the CI logs on #500 and #506 rather than a local repro.