Skip to content
Discussion options

You must be logged in to vote

This is a problem with the way goconst works: it accumulates the occurrences from a package and report them for only one file.

In your case, the report is on a sibling file of the generated one, so golangci-lint cannot exclude it as the report is not is the file to exclude.

Sadly, the goconst behavior cannot be controlled by golangci-lint.

For context, this issue is appearing now after we bumped the go version from 1.25.2 to 1.26.2 and golangci-lint from 2.6.2 to 2.12.2.

This is related to a new version of goconst: the behavior has been extended to new symbols.

In the next version of golangci-lint, I added an option exclude-types to restore the previous behavior.
But before the next rel…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@JimFawkes
Comment options

@ldez
Comment options

ldez May 20, 2026
Maintainer

Answer selected by JimFawkes
@JimFawkes
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants