Canonical golangci-lint pin cannot lint Go 1.27 modules; its successors enable exhaustruct_v5, which the canonical config does not disable #65

Closed
opened 2026-10-01 20:56:27 +02:00 by clawbot · 2 comments
Collaborator

The canonical lint pin, golangci/golangci-lint v2.12.2, is built with go1.26.2 and refuses any module whose go line is 1.27 or later:

Error: can't load config: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.1)

Go 1.27.1 is the current stable release. Every golangci-lint release that can lint it (v2.13.0 and later; v2.14.0 is built with go1.27.0) also adds the exhaustruct_v5 linter, the successor to exhaustruct. The canonical .golangci.yml disables only the deprecated exhaustruct, so under default: all the successor runs and flags every partial struct literal, for example a plain &http.Server{Addr: ..., Handler: ...}.

Asked: bump the canonical pin to a release built with go1.27, and add exhaustruct_v5 to the disable list next to exhaustruct, as was done for wsl and gomodguard.

Found while bringing sneak/api#1 to Go 1.27.1. That repo pins v2.14.0 and carries one //nolint:exhaustruct_v5 pointing here, to be removed once the canonical config disables the linter.

Model: opus-5-5

The canonical lint pin, `golangci/golangci-lint` v2.12.2, is built with go1.26.2 and refuses any module whose `go` line is 1.27 or later: ``` Error: can't load config: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.1) ``` Go 1.27.1 is the current stable release. Every golangci-lint release that can lint it (v2.13.0 and later; v2.14.0 is built with go1.27.0) also adds the `exhaustruct_v5` linter, the successor to `exhaustruct`. The canonical `.golangci.yml` disables only the deprecated `exhaustruct`, so under `default: all` the successor runs and flags every partial struct literal, for example a plain `&http.Server{Addr: ..., Handler: ...}`. Asked: bump the canonical pin to a release built with go1.27, and add `exhaustruct_v5` to the disable list next to `exhaustruct`, as was done for `wsl` and `gomodguard`. Found while bringing https://git.eeqj.de/sneak/api/issues/1 to Go 1.27.1. That repo pins v2.14.0 and carries one `//nolint:exhaustruct_v5` pointing here, to be removed once the canonical config disables the linter. Model: opus-5-5
Author
Collaborator

Plan. Settled by the record (prompts/REPO_POLICIES.md: linter configuration changes go to the canonical copy here; the golangci-lint image digest is the only pin), so no owner question.

  1. Pick the newest golangci-lint v2 release whose official image reports a Go 1.27 toolchain (golangci-lint --version inside the image). Pin it by image digest in the .golangci.yml paragraph of prompts/REPO_POLICIES.md, replacing the version, release date, digest and the --version output quoted there.
  2. In the canonical .golangci.yml, add exhaustruct_v5 to linters.disable beside exhaustruct, with the same short reason. If the new release adds or deprecates any other linter that default: all would now switch on or warn about, handle it the way wsl and gomodguard were handled, and list each one in the PR.
  3. git grep the canonical documents for the old version and digest (2.12.2, 5cceeef0, go1.26) and update every hit that names the canonical pin.

Done when: a scratch Go module with go 1.27 in go.mod, linted in the pinned image with the new config, runs with zero deprecation warnings, and a plain partial struct literal such as &http.Server{Addr: a, Handler: h} is not reported; the same module fails to lint under the old pin (the control); make check passes. The PR body states the new .golangci.yml sha256, because consuming repos verify it by hash.

Model: opus-5-5

Plan. Settled by the record (`prompts/REPO_POLICIES.md`: linter configuration changes go to the canonical copy here; the golangci-lint image digest is the only pin), so no owner question. 1. Pick the newest golangci-lint v2 release whose official image reports a Go 1.27 toolchain (`golangci-lint --version` inside the image). Pin it by image digest in the `.golangci.yml` paragraph of `prompts/REPO_POLICIES.md`, replacing the version, release date, digest and the `--version` output quoted there. 2. In the canonical `.golangci.yml`, add `exhaustruct_v5` to `linters.disable` beside `exhaustruct`, with the same short reason. If the new release adds or deprecates any other linter that `default: all` would now switch on or warn about, handle it the way `wsl` and `gomodguard` were handled, and list each one in the PR. 3. `git grep` the canonical documents for the old version and digest (`2.12.2`, `5cceeef0`, `go1.26`) and update every hit that names the canonical pin. Done when: a scratch Go module with `go 1.27` in `go.mod`, linted in the pinned image with the new config, runs with zero deprecation warnings, and a plain partial struct literal such as `&http.Server{Addr: a, Handler: h}` is not reported; the same module fails to lint under the old pin (the control); `make check` passes. The PR body states the new `.golangci.yml` sha256, because consuming repos verify it by hash. Model: opus-5-5
Author
Collaborator

Done in #79: the canonical pin moves to v2.14.0 (built with go1.27), and exhaustruct_v5 is disabled beside exhaustruct. The PR body carries the new .golangci.yml sha256.

Model: opus-5-5

Done in https://git.eeqj.de/sneak/prompts/pulls/79: the canonical pin moves to v2.14.0 (built with go1.27), and `exhaustruct_v5` is disabled beside `exhaustruct`. The PR body carries the new `.golangci.yml` sha256. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/prompts#65