Skip to content

ci: let golangci-lint track the Go toolchain - #19

Merged
reuvenharrison merged 1 commit into
mainfrom
ci/lint-track-go-toolchain
Oct 26, 2026
Merged

reuvenharrison merged 1 commit into
mainfrom
ci/lint-track-go-toolchain

Conversation

@reuvenharrison

Copy link
Copy Markdown
Collaborator

The lint job takes go-version: stable but pinned golangci-lint to v2.11.4. Once Go 1.27 became stable, that linter could no longer read the standard library's export data, so every stdlib import failed to typecheck:

could not import encoding/json (... export data version 5 is greater than maximum supported version 2)

All 9 reported issues were that one message. The last lint run here was in August, so it had been broken since 1.27 went stable and the next PR simply surfaced it.

Pinning the linter while floating the toolchain is the unstable half of each choice, so this floats the version, matching the oasdiff repo, whose lint is green on the same runner today. Two findings from the newer linters come with it:

  • reflect.Ptr -> reflect.Pointer in fields.go, which govet's inline check asks for (identical constant, legacy name).
  • goconst no longer reads test files. A literal repeated across table-driven cases reads better than a constant the reader has to look up.

golangci-lint run is clean locally on 2.15.0, and vet, gofmt and the suite pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_017e285CvofYf6joqC98gTXz

The lint job takes go-version: stable but pinned golangci-lint to
v2.11.4, so once Go 1.27 became stable the linter could no longer read
the standard library's export data and every stdlib import failed to
typecheck. Nothing had run it since August, so it broke quietly.

Float the version, as the oasdiff repo does, and settle what the newer
linters then report: reflect.Ptr becomes reflect.Pointer in fields.go,
and goconst leaves test files alone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017e285CvofYf6joqC98gTXz
@reuvenharrison
reuvenharrison merged commit bb9d301 into main Oct 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant