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 updated our project's golang version to 1.23.0 recently, and with it, most of our pre-commits, specifically version 1.60.3, stopped working with go above 1.22
I say it's a regression because it works on both previous versions, 1.60.1 and 1.60.2.
I'm sorry I couldn't test on a standalone linter, but 1.60.2 will now suffice. I'm just reporting to help you guys.
Version of golangci-lint
I don't use golangci-lint directly, but the version used with pre-commit is:
$ go version && go envgo version go1.23.1 linux/amd64GO111MODULE=''GOARCH='amd64'GOBIN=''GOCACHE='/home/myuser/.cache/go-build'GOENV='/home/myuser/.config/go/env'GOEXE=''GOEXPERIMENT=''GOFLAGS=''GOHOSTARCH='amd64'GOHOSTOS='linux'GOINSECURE=''GOMODCACHE='/home/myuser/go/pkg/mod'GONOPROXY='github.com/myorganization'GONOSUMDB='github.com/myorganization'GOOS='linux'GOPATH='/home/myuser/go'GOPRIVATE='github.com/myorganization'GOPROXY='https://proxy.golang.org,direct'GOROOT='/home/linuxbrew/.linuxbrew/Cellar/go/1.23.1/libexec'GOSUMDB='sum.golang.org'GOTMPDIR=''GOTOOLCHAIN='local'GOTOOLDIR='/home/linuxbrew/.linuxbrew/Cellar/go/1.23.1/libexec/pkg/tool/linux_amd64'GOVCS=''GOVERSION='go1.23.1'GODEBUG=''GOTELEMETRY='local'GOTELEMETRYDIR='/home/myuser/.config/go/telemetry'GCCGO='gccgo'GOAMD64='v1'AR='ar'CC='cc'CXX='c++'CGO_ENABLED='1'GOMOD='/home/myuser/myproject/go.mod'GOWORK=''CGO_CFLAGS='-O2 -g'CGO_CPPFLAGS=''CGO_CXXFLAGS='-O2 -g'CGO_FFLAGS='-O2 -g'CGO_LDFLAGS='-O2 -g'PKG_CONFIG='pkg-config'GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2009260257=/tmp/go-build -gno-record-gcc-switches'
Verbose output of running
pre-commit output:
golangci-lint............................................................Failed- hook id: golangci-lint- exit code: 3Error: can't load config: the Go language version (go1.22) used to build golangci-lint is lower than the targeted Go version (1.23.0)Failed executing command with 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.0)
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.).
Failed executing command with 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.0)
This is not related to the pre-commit and is not a regression but the expected behavior.
You are trying to use a golangci-lint binary compiled with go1.22 to analyze go1.23 code.
This cannot work, it's like if you are trying to compile go1.23 code with go1.22.
You should use a golangci-lint binary compiled with go1.23 to analyze go1.23 code.
Welcome
typecheck
section of the FAQ.Description of the problem
We updated our project's golang version to 1.23.0 recently, and with it, most of our pre-commits, specifically version 1.60.3, stopped working with go above 1.22
I say it's a regression because it works on both previous versions, 1.60.1 and 1.60.2.
I'm sorry I couldn't test on a standalone linter, but 1.60.2 will now suffice. I'm just reporting to help you guys.
Version of golangci-lint
I don't use golangci-lint directly, but the version used with pre-commit is:
Configuration
.pre-commit-config.yaml
Go environment
Verbose output of running
pre-commit output:
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: