Use golangci-lint v2 to lint with v1 config file? #5774
-
Is it possible? I have:
I am getting:
I'm then adding
Is it not possible to have golangci-lint v2 installed to lint different projects, using different versions of the config yaml file? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No you need a v2 config for v2 of However your v1 project can easily be upgraded with If you want to use different versions of I wrote |
Beta Was this translation helpful? Give feedback.
No you need a v2 config for v2 of
golangci-lint
. The reason is simply that the code to parse v1 configuration files isn't in the v2 binary. On top of that, some of the v1 configuration and way of working was changed or removed in v2.However your v1 project can easily be upgraded with
golangci-lint migrate
, see https://golangci-lint.run/product/migration-guide/.If you want to use different versions of
golangci-lint
in different projects you need multiple versions ofgolangci-lint
installed.I wrote
gclv
to easily install multiple versions and switch between them.