go
module_error
ai_generated
true
go: module github.com/example/[email protected] requires go 1.22, but your Go version is go1.20
ID: go/unsupported-go-version-in-module
80%Fix Rate
89%Confidence
0Evidence
2025-04-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.20 | active | — | — | — |
| 1.21 | active | — | — | — |
| 1.22 | active | — | — | — |
Root Cause
A module dependency requires a newer version of Go than what is installed.
generic中文
模块依赖需要比已安装版本更新的 Go 版本。
Workarounds
-
95% success Upgrade your Go installation to a compatible version.
Download and install Go 1.22 or later from golang.org/dl/.
-
80% success Use a older version of the module that supports your Go version.
Run 'go list -m -versions github.com/example/mod' and downgrade to an older version in go.mod.
Dead Ends
Common approaches that don't work:
-
Setting GOTOOLCHAIN to force using an older version.
70% fail
GOTOOLCHAIN only affects the toolchain selection; if the module requires a newer Go, it won't compile.
-
Removing the go directive from the dependency's go.mod.
100% fail
You cannot modify third-party modules; the requirement is enforced.