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

Open
opened 2026-10-01 20:56:27 +02:00 by clawbot · 0 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/prompts#65