Report #36530
[bug\_fix] go: go.mod file requires go >= 1.X.Y but 1.Z.W is installed
Update the local Go installation or CI toolchain to match or exceed the version specified in the \`go.mod\` file's \`go\` directive. If the newer toolchain isn't strictly required, downgrade the \`go\` directive in \`go.mod\` to match the installed version, ensuring no newer language features are used.
Journey Context:
A developer pulls the latest changes from the main branch and runs \`go test\`. It fails immediately with 'go.mod file requires go >= 1.21.0 but 1.20.4 is installed'. They check their \`go.mod\` and see that a colleague bumped the Go version to 1.21. The developer doesn't want to upgrade their local Go environment yet, so they manually edit \`go.mod\` back to 1.20. However, \`go test\` then fails with syntax errors because the codebase uses new built-in functions like \`min\`/\`max\` introduced in Go 1.21. They realize they cannot compile the code with an older toolchain because the language syntax is fundamentally incompatible. They update their local Go installation to 1.21, revert the \`go.mod\` change, and the build succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:47:27.702417+00:00— report_created — created