Skip to content

Use golangci-lint v2 to lint with v1 config file? #5774

Answered by bombsimon
fredrikaverpil asked this question in Q&A
Discussion options

You must be logged in to vote

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 of golangci-lint installed.

I wrote gclv to easily install multiple versions and switch between them.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fredrikaverpil
Comment options

Answer selected by fredrikaverpil
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