From d7ba9e96cecb9e5601f3ab6dfad7277b14369468 Mon Sep 17 00:00:00 2001 From: Joe Beda Date: Tue, 21 Jul 2026 17:53:36 -0700 Subject: [PATCH 1/2] Fix local `task staticcheck` under a go1.26 module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit staticcheck v0.7.0 is a Go 1.25-era release. Invoked as `go run …/staticcheck@v0.7.0`, the toolchain resolves to 1.25.x from staticcheck's own module, and a 1.25-built staticcheck can't analyze this module's go1.26 code ("package requires newer Go version go1.26"). Set GOTOOLCHAIN=go1.26.0+auto on the task so staticcheck is built by go1.26 or newer regardless of the ambient toolchain. CI was unaffected (setup-go pins GOTOOLCHAIN=local with go1.26 installed); this only fixed the local `task check` path. Drop the override once staticcheck v0.8.0 ships stable — it requires and builds on go1.26. Signed-off-by: Joe Beda --- Taskfile.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index fea1449..91fa884 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -55,6 +55,14 @@ tasks: staticcheck: desc: Run staticcheck (pinned version) + # staticcheck v0.7.0 is a Go 1.25-era release. Run as `go run …@v0.7.0`, its + # own go.mod makes the toolchain resolve to 1.25.x, and a 1.25-built + # staticcheck can't analyze this module's go1.26 code ("package requires + # newer Go version go1.26"). Force a floor of go1.26 (auto-upgrading if a + # newer toolchain is the default) so staticcheck is built by go1.26+. Drop + # this once staticcheck v0.8.0 ships stable — it requires and builds on 1.26. + env: + GOTOOLCHAIN: go1.26.0+auto cmds: - go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 ./... From c7d59a7c87d9ade72df241b53bfae13e9ba24b72 Mon Sep 17 00:00:00 2001 From: Joe Beda Date: Tue, 21 Jul 2026 18:01:02 -0700 Subject: [PATCH 2/2] Fix local `task lint` under a go1.26 module Same root cause as the staticcheck fix: a golangci-lint binary built with an older Go toolchain refuses to target this module's go1.26 code ("the Go language version (go1.25) used to build golangci-lint is lower than the targeted Go version (1.26)"). Run the pinned version via `go run` with the same GOTOOLCHAIN=go1.26.0+auto floor, so it's built by go1.26+ regardless of any locally installed golangci-lint, and pin it to CI's action version (v2.12.2). `task check` now passes end to end locally. Signed-off-by: Joe Beda --- Taskfile.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 91fa884..2590476 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -67,9 +67,16 @@ tasks: - go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 ./... lint: - desc: Run golangci-lint + desc: Run golangci-lint (pinned version) + # A golangci-lint binary built with an older Go toolchain refuses to target + # this module's go1.26 code. Run the pinned version via `go run` with the + # same go1.26 floor as staticcheck, so it is built by go1.26+ regardless of + # any locally installed golangci-lint. The version matches CI's pinned + # golangci-lint-action version. + env: + GOTOOLCHAIN: go1.26.0+auto cmds: - - golangci-lint run ./... + - go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 run ./... fmt: desc: Format all Go code