Repository navigation
ci: unbreak the lint job on the current Go toolchain - #24
Merged
Merged
Conversation
The workflow installs the latest Go (gobrew) but pins golangci-lint v2.2.0, which cannot decode the export data of the current standard library: "could not import sync/atomic ... export data version 5 is greater than maximum supported version 2". It fails on main as well, so no pull request can go green. Bump the linter to v2.13.0, built with Go 1.27, and stop applying goconst to tests: test tables repeat fixture strings on purpose.
Bumping golangci-lint to v2.13.0 is not enough: its prebuilt binary embeds go/types from Go 1.27.0, and the workflow installs Go 1.27.4, whose export data version (5) is newer than it can decode (4). Build the linter from source in goinstall mode so it always matches the toolchain the workflow uses.
Bumping golangci-lint alone does not help: the workflow takes the latest Go, and 1.27.4 emits export data version 5 while the prebuilt linter (built with 1.27.0) supports 4, so every typecheck import fails. Pin Go to 1.27.0 and keep the linter at v2.13.0, which is the pairing verified locally.
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.
Why
The lint job cannot run at all. It installs the latest Go through gobrew but pins golangci-lint v2.2.0, which was built with an older Go and cannot decode the current standard library export data:
This is not specific to a branch: a
workflow_dispatchrun onmainfails the same way (run 43505748106), so every pull request is red before its own code is looked at.What changes
golangci-lintgoes from v2.2.0 to v2.13.0, which is built with Go 1.27 and reads the current export data.goconstno longer applies to tests. Once the linter runs again it reports 17goconstfindings onmain_test.go, all of them fixture strings that test tables repeat by design (https://github.com/user/repo,/home/test,user/repo, …). Production code stays covered.Verification
golangci-lint run ./...with v2.13.0 in this tree:0 issues.(17 before the settings change),golangci-lint config verifypasses,go test ./...passes.