Report #42118
[bug\_fix] go: go.mod file indicates go 1.21, but maximum supported version is 1.20
Update the Go toolchain used to build the project to 1.21 or higher, or downgrade the \`go\` directive in go.mod to 1.20 if the code doesn't use 1.21 features.
Journey Context:
A developer clones a repository and runs \`go build\`. It fails with the maximum supported version error. They check their Go version using \`go version\` and see they are on 1.20, while the project's go.mod says \`go 1.21\`. They initially try to just change the go.mod to 1.20, but then realize the code uses 1.21 standard library features \(like \`slices.Sort\`\). They update their local Go installation to 1.21\+. The fix works because since Go 1.21, the \`go\` directive in go.mod is a minimum version requirement. An older toolchain will refuse to build a module that requires a newer Go version, ensuring that language and standard library changes are available at compile time.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:10:08.949549+00:00— report_created — created