ci: unblock Lint job (Go version mismatch between runtime build & go.mod target)#10
Merged
zeekay merged 1 commit intoluxfi:mainfrom Apr 23, 2026
Merged
Conversation
The `Lint` job has been failing on master with:
can't load config: the Go language version (go1.24) used to build
golangci-lint is lower than the targeted Go version (1.26.1)
Root cause: `.github/workflows/ci.yml` used
`golangci/golangci-lint-action@v6` with `version: latest`, which resolves
to `golangci-lint v1.64.8`. That binary is built with Go 1.24, while
`go.mod` targets `go 1.26.1`. golangci-lint refuses to load the config
when the build-time Go version is lower than the `run.go` target it
infers from `go.mod`.
Minimal fix:
- Add `run.go: "1.24"` to `.golangci.yml` so the version check sees a
target equal to the build version and proceeds.
- Pin `golangci-lint-action` to `version: v1.64.8` explicitly. The v1
config format we use today is not parsed by golangci-lint v2.x, so
future drift of `latest` onto v2 would silently break us again.
Non-goals: migrating `.golangci.yml` to the v2 schema. That is a
separate, larger PR once a golangci-lint release built with Go 1.26 is
available.
This unblocks stalled docs PRs: luxfi#6, luxfi#7, luxfi#8 (all UNSTABLE purely because
of this lint failure on master).
— [kcolbchain](https://kcolbchain.com) / [Abhishek Krishna](https://abhishekkrishna.com)
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.
Problem
Master's
Lintjob has been failing every run with:Example failing run: https://github.com/luxfi/threshold/actions/runs/24754524639
Root cause
.github/workflows/ci.ymlruns:The action resolves
latestto golangci-lint v1.64.8, which is thelast v1 release. That binary is published as a pre-built artifact
compiled with Go 1.24. Our
go.modtargets Go 1.26.1.golangci-lint's config loader calls
goutil.CheckGoVersion, whichcompares the runtime Go version (from
runtime.Version()of thebinary itself) against the target Go version inferred from
go.mod.Since
1.24 < 1.26.1, it refuses to load the config and exits.golangci-lint v2.x would help (v2.11.4 is built with Go 1.25), but
moving to v2 requires migrating
.golangci.ymlto the v2 schema(
version: "2"+ restructuredlinters/formatters/issuesblocks).That is a bigger, separate change.
Fix (minimal)
.golangci.yml— addrun.go: "1.24"so the version check seesa target equal to the build version and proceeds. The linter then
runs normally; we lose Go 1.26-specific language analysis but keep
all vet/staticcheck/etc. working.
.github/workflows/ci.yml— pingolangci/golangci-lint-action@v6toversion: v1.64.8explicitly.Today our v1 config would break if
latestever drifts onto v2, solet's pin until we're ready to migrate.
- name: Run golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: latest + # Pin to v1.64.8 (last v1 release) to pair with the v1-format + # .golangci.yml. `latest` can drift to v2 and fail config parsing. + version: v1.64.8No source code changes. Workflow- and lint-config-only.
Why this unblocks us
Three docs PRs are currently UNSTABLE purely because of this master
lint failure, not because of anything they introduce:
Once this merges and
mainis green, those PRs should go green onre-run (or after a trivial rebase).
Follow-ups (not this PR)
Test (macos)is separately flaky and deserves its owninvestigation.
.golangci.ymlto v2 schema and bump the action to@v8once golangci-lint ships a build against Go 1.26 (then we can drop
the
run.gopin).— kcolbchain / Abhishek Krishna