Description
Update
2023-08-11
go1.21 is now officially fully supported since v1.54.1.
2023-08-10
The problems with ruleguard/gocritic are fixed.
A new release will happen quickly.
2023-08-09
go1.21 is now officially supported since v1.54.0 but there are still problems:
-
ruleguard
(a "rule" insidego-critic
) doesn't work with go1.21. go1.21: load rules: parse rules file: typechecker error: ...: could not import quasilyte/go-ruleguard#449 - in some cases
go-critic
fails to load its built-in/embedded rules. go1.21: load embedded ruleguard rules: rules/rules.go:13: can't load fmt go-critic/go-critic#1359
Is golangci-lint support go1.21?
No, and yes.
Basically, golangci-lint supports Go versions lower or equal to the Go version used to build it.
Go version (build) | Supported Go versions (code) | Not supported Go versions (code) |
---|---|---|
go1.20 | <= go1.20 (go1.20, go1.19, etc.) | > go1.20 (go1.21, go1.22, etc.) |
go1.19 | <= go1.19 (go1.19, go1.18, etc.) | > go1.19 (go1.20, go1.21, etc.) |
The current binaries from the releases page and the Docker images have been built with go1.20 and will be built with go1.20 as long as go1.21 is not GA.
So those binaries/images don't support go1.21.
https://golangci-lint.run/usage/faq/#which-go-versions-are-supported
In addition, of the Go version used to build it, some linters could need to be updated to support newer versions of Go, and internal pieces of golangci-lint could also need to be updated.
You can follow the PR #3922 to see the progress on this topic.
Sponsoring is a good way to sustain open source maintainers: sponsor me