What this thread does
Do first: run go version and go env GOTOOLCHAIN, then choose whether CI may select or download another compiler.
Short answer
As of November 2026, Go 1.27.4 is a concrete supported upgrade target. The go directive declares a required minimum; toolchain suggests a compiler for the main module. (toolchain management).
Choose / don't choose
- Preinstalled compiler: choose
GOTOOLCHAIN=localfor CI that must fail rather than switch; don't assume the bundled compiler is the one named in go.mod. - Automatic selection: choose
autowhen downloads and module-driven switches are allowed; don't use it when CI must remain on one installed compiler. - Upstream compatible release: choose a dependency release meeting your minimum Go requirement; don't expect
go getto search backwards automatically for that policy (alexander-bachmann's report). - Temporary replace: choose a reviewed fork/local patch for an identified incompatibility with an exit plan; don't treat replacement as changing the original module's compatibility guarantees (module reference).
Not for: runtime synctest or HTTP timeout regressions; see go-setevent-errno-6-synctest-channel-and-http-timeout-errors.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
GOTOOLCHAIN | local uses bundled compiler; auto enables toolchain switching; path allows selection only from PATH | Current Go docs | toolchains |
go | Set the actual supported minimum, at least every dependency's required Go version | Current Go docs | module directive |
toolchain | go1.27.4 as the preferred compiler if adopting this release; go declares the minimum required version | Current Go docs | toolchains |
replace | Scope to the affected module/version where possible; replacement must also be required to enter graph | Current Go docs | replacement |
go mod tidy -diff | Inspect required go.mod/go.sum edits without mutation; nonzero when diff exists | Current Go docs | tidy |
Order of operations
1. Install the selected compiler in CI and record its effective version. Inspect go.work as well as go.mod; workspace directives participate in selection (toolchains). 2. Use go get to manage the go and toolchain lines when intentionally changing the module minimum or preferred compiler (toolchain management). Select explicit compatible dependency versions for the upgrade. 3. Adapt changed imports/APIs, then run go mod tidy after the dependency/toolchain edits. Review go.mod and go.sum together. Tidy includes platform/tag-specific imports and tests; a host-only build is narrower (tidy). 4. Build and run the relevant tests under the intended compiler, including the oldest claimed minimum if retaining one. For a no-switch CI policy rerun with GOTOOLCHAIN=local; keep any replacement in review until its upstream substitute is available.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
GOTOOLCHAIN=local in a newer-Go requirement error | Bundled compiler is below module/dependency minimum and switching is disabled | Install a sufficient compiler, deliberately allow switching, or select a compatible dependency | toolchains, dependency-selection report |
| Replacement has no effect (symptom) | replace alone does not add the module to the graph | Retain/add the matching require; inspect effective workspace overrides too | module reference |
Russ Cox's forward-compatibility article explains the mandatory-minimum boundary; alexander-bachmann's issue records dependency selection behavior. They establish the mechanism, not compatibility of an unnamed third-party package.
Missing
- The linked source does not confirm: a toolchain pin changing a dependency’s language compatibility.
- Dependency identities and the oldest supported compiler are unspecified; there is no universal go-directive value or replacement target.
- This is a compiler/module reconciliation recipe, not a complete migration inventory for an unspecified starting release.
Checked
2026-11-12; Go release history, toolchain and module references, go command reference, Cox article and dated dependency-selection issue read. No module or build commands executed.
Started from a post by @Go project, packaged by the editor. Original post