You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We were using the golangci linter as part of a CI/CD pipeline against a moving docker image tag.
Consequently, when v2 was made available, all of a sudden, our job started failing.
I did try to migrate our current setup over to v2, but I did notice that our current code fails for the case where we configure gofmt as part of the linter.
Error: can't load config: gofmt is a formatter
Failed executing command with error: can't load config: gofmt is a formatter
Version info: we used golangci/golangci-lint:latest-alpine the logs mention (redacted):
level=info msg="golangci-lint has version 2.0.1 built with go1.24.1 from e8927ce2 on 2025-03-24T20:34:31Z"
...
Using docker image sha256:80a23913b76757104bb082e05fc7521ec5c4dd548071433410b1ac44511be8ba for golangci/golangci-lint:latest-alpine with digest golangci/golangci-lint@sha256:66854a432087d43cee95e82406b895f93a2cf6448e3edc67f46ce057dab07c7a ...
..
level=info msg="[config_reader] Used config file .golangci.yml"Error: can't load config: gofmt is a formatterFailed executing command with error: can't load config: gofmt is a formatter
A minimal reproducible example or link to a public repository
// add your code here
Validation
Yes, I've included all information above (version, config, etc.).
Welcome
typecheck
section of the FAQ.How did you install golangci-lint?
Docker
Description of the problem
We were using the golangci linter as part of a CI/CD pipeline against a moving docker image tag.
Consequently, when v2 was made available, all of a sudden, our job started failing.
I did try to migrate our current setup over to v2, but I did notice that our current code fails for the case where we configure
gofmt
as part of the linter.Full setup; invocation:
config file:
Error message:
Version info: we used
golangci/golangci-lint:latest-alpine
the logs mention (redacted):My guess is that the issue lies here:
golangci-lint/pkg/config/linters.go
Line 43 in 474ac3e
The code checks whether linter isn't a formatter. For
gofmt
, it's actually both a formatter and a linter, hence the issue.Version of golangci-lint
Configuration
Go environment
Verbose output of running
A minimal reproducible example or link to a public repository
// add your code here
Validation
Supporter
The text was updated successfully, but these errors were encountered: