Closed rach-id closed 1 month ago
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.
Hello,
golangci-lint has version v1.61.0 built with go1.22.3 from (unknown, modified: ?, mod sum: "h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8=") on (unknown) ... Error: can't load config: the Go language version (go1.22) used to build golangci-lint is lower than the targeted Go version (1.23.1)
You are using a custom version of golangci-lint build with go1.22 but you are trying to analyze go1.23 code, this cannot work.
You should use a version of golangci-lint compiled with go1.23 to analyze go1.23 code.
But this is the latest version. Or you mean I should rebuild it from source using go 1.23.1?
To analyze go1.23 code, golangci-lint needs to be compiled by go1.23. This is not related to the golangci-lint version.
The patch version (go1.23.1) of Go doesn't impact this, because there is a difference between Go language version (Go family version) and Go version.
https://go.dev/doc/toolchain#version
Your problem is that you are compiling with go1.22.
INFO golangci-lint has version v1.61.0 built with go1.22.3 from (unknown, modified: ?, mod sum: "h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8=") on (unknown)
The commands go run
and go install
are compiling golangci-lint, and you are compiling with go1.22 (go1.22.3) and not go1.23.
I recommend using the official golangci-lint binaries:
aaaah, got you. Thanks a lot for your help 🙏 :pray:
Welcome
typecheck
section of the FAQ.Description of the problem
I am trying to use the linter locally on a go 1.23.1 project, and it still doesn't work (even tho we have this issue: https://github.com/golangci/golangci-lint/issues/4837):
Version of golangci-lint
Configuration
Go environment
Verbose output of running
A minimal reproducible example or link to a public repository
Validation
Supporter