cmd/go: go mod init writes current toolchain version instead of go 1.25.0 starting from Go 1.26.1

45 views
Skip to first unread message

Scot

unread,
Jul 4, 2026, 11:59:35 AM (14 hours ago) Jul 4
to golang-nuts
Hi team,
Per Go 1.26 documentation, all go1.26.x toolchains should generate go 1.25.0 via go mod init.
Test results with official tarballs:

  1. 1. go1.26.0 (darwin-amd64 & linux-amd64) → go 1.25.0 (correct)
  2. 2. go1.26.1/2/3/4 (darwin-amd64 & linux-amd64) → current toolchain version (incorrect)

All binaries verified by SHA256, tested in clean isolated environment without local environment overrides.
No release notes mention any intentional change to this behavior starting from Go 1.26.1.
Thanks.

Dan Kortschak

unread,
Jul 4, 2026, 4:56:17 PM (9 hours ago) Jul 4
to golan...@googlegroups.com
On Fri, 2026-07-03 at 19:24 +0800, Scot wrote:
> Hi team,Per Go 1.26 documentation, all go1.26.x toolchains should
> generate go 1.25.0 via go mod init.
> Test results with official tarballs:
>
>    1. 1. go1.26.0 (darwin-amd64 & linux-amd64) → go 1.25.0 (correct)
>    2. 2. go1.26.1/2/3/4 (darwin-amd64 & linux-amd64) → current
> toolchain version (incorrect)
>    3.
> All binaries verified by SHA256, tested in clean isolated environment
> without local environment overrides.No release notes mention any
> intentional change to this behavior starting from Go 1.26.1.
> Thanks.

This was done in

commit e28ac674af90b079a7018ce8275885b3b5366d2a (HEAD)
Author: Michael Matloob <mat...@golang.org>
Date: Fri Feb 27 10:03:36 2026 -0800

[release-branch.go1.26] cmd/go: revert update default go directive in mod or work init

This restores the previous behavior of setting go directive to the toolchain's version as per #77653.

For #77653
Fixes #77860

The first issue explains why. It seems the documentation update was
missed in that change, https://go-review.googlesource.com/c/go/+/749980

Reply all
Reply to author
Forward
0 new messages