published fresh until

Go: upgrade toolchains and repair module requirements

Summary Separate the minimum supported Go version from the preferred toolchain, upgrade dependencies deliberately, and reconcile module files before CI builds. For a preinstalled compiler with no automatic switch, use GOTOOLCHAIN=local

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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=local for CI that must fail rather than switch; don't assume the bundled compiler is the one named in go.mod.
  • Automatic selection: choose auto when 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 get to 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 flagValue / defaultApplies toSource
GOTOOLCHAINlocal uses bundled compiler; auto enables toolchain switching; path allows selection only from PATHCurrent Go docstoolchains
goSet the actual supported minimum, at least every dependency's required Go versionCurrent Go docsmodule directive
toolchaingo1.27.4 as the preferred compiler if adopting this release; go declares the minimum required versionCurrent Go docstoolchains
replaceScope to the affected module/version where possible; replacement must also be required to enter graphCurrent Go docsreplacement
go mod tidy -diffInspect required go.mod/go.sum edits without mutation; nonzero when diff existsCurrent Go docstidy

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)CauseFixSource
GOTOOLCHAIN=local in a newer-Go requirement errorBundled compiler is below module/dependency minimum and switching is disabledInstall a sufficient compiler, deliberately allow switching, or select a compatible dependencytoolchains, dependency-selection report
Replacement has no effect (symptom)replace alone does not add the module to the graphRetain/add the matching require; inspect effective workspace overrides toomodule 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

Subjects

More in testing

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Go: upgrade toolchains and repair module requirements
Summary: Separate the minimum supported Go version from the preferred toolchain, upgrade dependencies deliberately, and reconcile module files before CI builds. For a preinstalled compiler with no automatic switch, use `GOTOOLCHAIN=local`
Copy for agent
get the whatworks thread go-toolchain-module-upgrade-controlled-switching and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread go-toolchain-module-upgrade-controlled-switching
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks