Skip to content

Commit 09fd0ed

Browse files
committed
ci: lint follows go.mod's Go, not whatever is stable today
golangci-lint is a prebuilt binary and can only parse source up to the Go release it was built with. `go-version: stable` hands it whatever Go shipped most recently, so Go 1.27.0 going stable made v2.11 (built with go1.26) panic on load — "file requires newer Go version go1.27" — turning lint red on every open PR without a single repo change. ci.yml already resolves Go from go.mod. Do the same here so the linter's toolchain moves when the module moves, and an upstream release cannot break the gate on its own.
1 parent 801967f commit 09fd0ed

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/lint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ jobs:
1717
- uses: actions/checkout@v7
1818
- uses: actions/setup-go@v7
1919
with:
20-
go-version: stable
20+
# Follow the module's own Go, the way ci.yml already does. Chasing
21+
# "stable" means every upstream Go release lands here unannounced,
22+
# and golangci-lint is a prebuilt binary that can only parse source
23+
# up to the Go it was built with: Go 1.27.0 going stable made v2.11
24+
# (built with go1.26) panic with "file requires newer Go version",
25+
# which is a repo-wide red on every open PR, triggered by nothing in
26+
# the repo. Pinning to go.mod means lint only moves when we move.
27+
go-version-file: "go.mod"
2128
- name: golangci-lint
2229
uses: golangci/golangci-lint-action@v9
2330
with:

0 commit comments

Comments
 (0)