[go] cmd/go: update default go directive in mod init

9 views
Skip to first unread message

Ian Alexander (Gerrit)

unread,
Nov 14, 2025, 3:57:33 PM11/14/25
to goph...@pubsubhelper.golang.org, Go LUCI, Dmitri Shuralyov, Michael Matloob, golang-co...@googlegroups.com
Attention needed from Dmitri Shuralyov and Michael Matloob

Ian Alexander voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Dmitri Shuralyov
  • Michael Matloob
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
Gerrit-Change-Number: 720480
Gerrit-PatchSet: 7
Gerrit-Owner: Ian Alexander <ji...@google.com>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Ian Alexander <ji...@google.com>
Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
Gerrit-Attention: Michael Matloob <mat...@golang.org>
Gerrit-Attention: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Comment-Date: Fri, 14 Nov 2025 20:57:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Michael Matloob (Gerrit)

unread,
Nov 18, 2025, 4:54:54 PM11/18/25
to Ian Alexander, goph...@pubsubhelper.golang.org, Go LUCI, Dmitri Shuralyov, golang-co...@googlegroups.com
Attention needed from Dmitri Shuralyov and Ian Alexander

Michael Matloob added 8 comments

File src/cmd/go/internal/gover/local.go
Line 39, Patchset 7 (Latest):func LocalInit() string {
Michael Matloob . unresolved

We should add this function to the modload package since it's only relevant to `go mod init` and `go work init`.

(this package is a "lower level" package that should have more generally applicable functions)

We should probably choose a name that more clearly indicates that it's the default go version in a new module. (init is an overloaded term, for example modload.Init or the init function in a package, so it can be unclear which meaning it refers to) Don't have a super good one off the top of my head but maybe `DefaultModInitGoVersion` ?

Line 41, Patchset 7 (Latest): if strings.Count(v, ".") < 2 {
Michael Matloob . unresolved

Could we parse the version to figure out if it's a language or release version? Ideally we shouldn't be doing manual string operations on it. If not, maybe we can add a comment about why we can't parse it?

File src/cmd/go/testdata/script/mod_edit.txt
Line 2, Patchset 7 (Latest):env TESTGO_VERSION=go1.26.0
Michael Matloob . unresolved

add a comment saying we need this to be able to check produced mod files for equality?

Line 14, Patchset 7 (Latest):cmpenv go.mod $WORK/go.mod.init
Michael Matloob . unresolved

these can be cmp now that we don't use `$goversion`

File src/cmd/go/testdata/script/mod_init_version.txt
Line 3, Patchset 7 (Latest):cmp go.mod go.mod.want1
Michael Matloob . unresolved

maybe we can name the want files based on the version they contain so it's easier to see what the test is looking for by reading the test case without looking down to see the contents of the files?

File src/cmd/go/testdata/script/work_init_path.txt
Line 5, Patchset 7 (Latest):env TESTGO_VERSION=go1.20
Michael Matloob . unresolved

1.18.0 never existed (and would never be returned by `gover.LocalInit` in practice), so it would probably be better to bump all the version up so that it's greater than 1.23 (so that the version returned by LocalInit is > 1.21.0)

File src/cmd/go/testdata/script/work_init_version.txt
Line 3, Patchset 7 (Latest):cmp go.work go.work.want1
Michael Matloob . unresolved

see comment on the mod_init_version test case: could we name these files semantically like `go.work.want_1_24_0`?

File src/cmd/go/testdata/script/work_sync_toolchain.txt
Line 25, Patchset 7 (Latest):env TESTGO_VERSION=go1.21.0
Michael Matloob . unresolved

why did we need to make this change?

Open in Gerrit

Related details

Attention is currently required from:
  • Dmitri Shuralyov
  • Ian Alexander
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
    Gerrit-Change-Number: 720480
    Gerrit-PatchSet: 7
    Gerrit-Owner: Ian Alexander <ji...@google.com>
    Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
    Gerrit-Reviewer: Ian Alexander <ji...@google.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Attention: Ian Alexander <ji...@google.com>
    Gerrit-Attention: Dmitri Shuralyov <dmit...@golang.org>
    Gerrit-Comment-Date: Tue, 18 Nov 2025 21:54:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Ian Alexander (Gerrit)

    unread,
    Nov 21, 2025, 12:19:01 PM11/21/25
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
    Attention needed from Dmitri Shuralyov and Ian Alexander

    Ian Alexander uploaded new patchset

    Ian Alexander uploaded patch set #8 to this change.
    Following approvals got outdated and were removed:
    • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dmitri Shuralyov
    • Ian Alexander
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
      Gerrit-Change-Number: 720480
      Gerrit-PatchSet: 8
      unsatisfied_requirement
      open
      diffy

      Ian Alexander (Gerrit)

      unread,
      Nov 21, 2025, 1:12:29 PM11/21/25
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Dmitri Shuralyov and Ian Alexander

      Ian Alexander uploaded new patchset

      Ian Alexander uploaded patch set #9 to this change.
      Following approvals got outdated and were removed:
      • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dmitri Shuralyov
      • Ian Alexander
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
      Gerrit-Change-Number: 720480
      Gerrit-PatchSet: 9
      unsatisfied_requirement
      open
      diffy

      Ian Alexander (Gerrit)

      unread,
      Nov 21, 2025, 1:15:00 PM11/21/25
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Dmitri Shuralyov and Ian Alexander

      Ian Alexander uploaded new patchset

      Ian Alexander uploaded patch set #10 to this change.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dmitri Shuralyov
      • Ian Alexander
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
      Gerrit-Change-Number: 720480
      Gerrit-PatchSet: 10
      unsatisfied_requirement
      open
      diffy

      Michael Matloob (Gerrit)

      unread,
      Nov 21, 2025, 1:19:54 PM11/21/25
      to Ian Alexander, goph...@pubsubhelper.golang.org, Go LUCI, Dmitri Shuralyov, golang-co...@googlegroups.com
      Attention needed from Dmitri Shuralyov and Ian Alexander

      Michael Matloob voted and added 1 comment

      Votes added by Michael Matloob

      Code-Review+2

      1 comment

      File src/cmd/go/testdata/script/work_init_path.txt
      Line 19, Patchset 10 (Latest):go 1.18.0
      Michael Matloob . unresolved

      i think we can revert this?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dmitri Shuralyov
      • Ian Alexander
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
      Gerrit-Change-Number: 720480
      Gerrit-PatchSet: 10
      Gerrit-Owner: Ian Alexander <ji...@google.com>
      Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
      Gerrit-Reviewer: Ian Alexander <ji...@google.com>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-Attention: Ian Alexander <ji...@google.com>
      Gerrit-Attention: Dmitri Shuralyov <dmit...@golang.org>
      Gerrit-Comment-Date: Fri, 21 Nov 2025 18:19:51 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ian Alexander (Gerrit)

      unread,
      Nov 21, 2025, 1:20:08 PM11/21/25
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Dmitri Shuralyov and Ian Alexander

      Ian Alexander uploaded new patchset

      Ian Alexander uploaded patch set #11 to this change.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dmitri Shuralyov
      • Ian Alexander
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
      Gerrit-Change-Number: 720480
      Gerrit-PatchSet: 11
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Matloob (Gerrit)

      unread,
      Nov 21, 2025, 1:20:19 PM11/21/25
      to Ian Alexander, goph...@pubsubhelper.golang.org, Go LUCI, Michael Matloob, Dmitri Shuralyov, golang-co...@googlegroups.com
      Attention needed from Dmitri Shuralyov and Ian Alexander

      Michael Matloob voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dmitri Shuralyov
      • Ian Alexander
      Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
        Gerrit-Change-Number: 720480
        Gerrit-PatchSet: 10
        Gerrit-Owner: Ian Alexander <ji...@google.com>
        Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
        Gerrit-Reviewer: Ian Alexander <ji...@google.com>
        Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
        Gerrit-Reviewer: Michael Matloob <mat...@google.com>
        Gerrit-Attention: Ian Alexander <ji...@google.com>
        Gerrit-Attention: Dmitri Shuralyov <dmit...@golang.org>
        Gerrit-Comment-Date: Fri, 21 Nov 2025 18:20:09 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Ian Alexander (Gerrit)

        unread,
        Nov 21, 2025, 1:21:29 PM11/21/25
        to goph...@pubsubhelper.golang.org, Michael Matloob, Go LUCI, Michael Matloob, Dmitri Shuralyov, golang-co...@googlegroups.com
        Attention needed from Dmitri Shuralyov

        Ian Alexander added 9 comments

        File src/cmd/go/internal/gover/local.go
        Line 39, Patchset 7:func LocalInit() string {
        Michael Matloob . resolved

        We should add this function to the modload package since it's only relevant to `go mod init` and `go work init`.

        (this package is a "lower level" package that should have more generally applicable functions)

        We should probably choose a name that more clearly indicates that it's the default go version in a new module. (init is an overloaded term, for example modload.Init or the init function in a package, so it can be unclear which meaning it refers to) Don't have a super good one off the top of my head but maybe `DefaultModInitGoVersion` ?

        Ian Alexander

        Done

        Line 41, Patchset 7: if strings.Count(v, ".") < 2 {
        Michael Matloob . resolved

        Could we parse the version to figure out if it's a language or release version? Ideally we shouldn't be doing manual string operations on it. If not, maybe we can add a comment about why we can't parse it?

        Ian Alexander

        Done

        File src/cmd/go/testdata/script/mod_edit.txt
        Line 2, Patchset 7:env TESTGO_VERSION=go1.26.0
        Michael Matloob . resolved

        add a comment saying we need this to be able to check produced mod files for equality?

        Ian Alexander

        Done

        Line 14, Patchset 7:cmpenv go.mod $WORK/go.mod.init
        Michael Matloob . resolved

        these can be cmp now that we don't use `$goversion`

        Ian Alexander

        Done

        File src/cmd/go/testdata/script/mod_init_version.txt
        Line 3, Patchset 7:cmp go.mod go.mod.want1
        Michael Matloob . resolved

        maybe we can name the want files based on the version they contain so it's easier to see what the test is looking for by reading the test case without looking down to see the contents of the files?

        Ian Alexander

        Done

        File src/cmd/go/testdata/script/work_init_path.txt
        Line 5, Patchset 7:env TESTGO_VERSION=go1.20
        Michael Matloob . resolved

        1.18.0 never existed (and would never be returned by `gover.LocalInit` in practice), so it would probably be better to bump all the version up so that it's greater than 1.23 (so that the version returned by LocalInit is > 1.21.0)

        Ian Alexander

        Done

        Line 19, Patchset 10:go 1.18.0
        Michael Matloob . resolved

        i think we can revert this?

        Ian Alexander

        Done

        File src/cmd/go/testdata/script/work_init_version.txt
        Line 3, Patchset 7:cmp go.work go.work.want1
        Michael Matloob . resolved

        see comment on the mod_init_version test case: could we name these files semantically like `go.work.want_1_24_0`?

        Ian Alexander

        Done

        File src/cmd/go/testdata/script/work_sync_toolchain.txt
        Line 25, Patchset 7:env TESTGO_VERSION=go1.21.0
        Michael Matloob . resolved

        why did we need to make this change?

        Ian Alexander

        With the removal of the TESTGO_VERSION_INIT (in a previous patchset), this is no longer necessary and I've removed it.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Dmitri Shuralyov
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
        Gerrit-Change-Number: 720480
        Gerrit-PatchSet: 11
        Gerrit-Owner: Ian Alexander <ji...@google.com>
        Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
        Gerrit-Reviewer: Ian Alexander <ji...@google.com>
        Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
        Gerrit-Reviewer: Michael Matloob <mat...@google.com>
        Gerrit-Attention: Dmitri Shuralyov <dmit...@golang.org>
        Gerrit-Comment-Date: Fri, 21 Nov 2025 18:21:25 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Michael Matloob <mat...@golang.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Dmitri Shuralyov (Gerrit)

        unread,
        Nov 21, 2025, 4:43:10 PM11/21/25
        to Ian Alexander, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Matloob, Michael Matloob, golang-co...@googlegroups.com
        Attention needed from Ian Alexander

        Dmitri Shuralyov voted and added 2 comments

        Votes added by Dmitri Shuralyov

        Code-Review+1

        2 comments

        Patchset-level comments
        File-level comment, Patchset 11 (Latest):
        Dmitri Shuralyov . resolved

        I left a trivial nit, but overall this looks good and I'm not seeing any issues. Thanks for implementing this. Leaving a +1 since I mostly defer to Michael on this review, and he already +2'ed.

        File src/cmd/go/internal/modload/init.go
        Line 2265, Patchset 11 (Latest): if isPrereleaseVersion(v) {
        Dmitri Shuralyov . unresolved

        This is a tiny nit. Consider naming this `isPrereleaseOrDevelVersion`, since it is in fact checking for development versions too, but its current name doesn't make that very visible.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Ian Alexander
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
        Gerrit-Change-Number: 720480
        Gerrit-PatchSet: 11
        Gerrit-Owner: Ian Alexander <ji...@google.com>
        Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
        Gerrit-Reviewer: Ian Alexander <ji...@google.com>
        Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
        Gerrit-Reviewer: Michael Matloob <mat...@google.com>
        Gerrit-Attention: Ian Alexander <ji...@google.com>
        Gerrit-Comment-Date: Fri, 21 Nov 2025 21:43:05 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Ian Alexander (Gerrit)

        unread,
        Nov 21, 2025, 4:47:47 PM11/21/25
        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Ian Alexander

        Ian Alexander uploaded new patchset

        Ian Alexander uploaded patch set #12 to this change.
        Following approvals got outdated and were removed:
        • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Ian Alexander
        Submit Requirements:
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: newpatchset
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
          Gerrit-Change-Number: 720480
          Gerrit-PatchSet: 12
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Ian Alexander (Gerrit)

          unread,
          Nov 21, 2025, 8:25:25 PM11/21/25
          to goph...@pubsubhelper.golang.org, Go LUCI, Dmitri Shuralyov, Michael Matloob, Michael Matloob, golang-co...@googlegroups.com
          Attention needed from Dmitri Shuralyov

          Ian Alexander voted and added 1 comment

          Votes added by Ian Alexander

          Commit-Queue+1

          1 comment

          File src/cmd/go/internal/modload/init.go
          Line 2265, Patchset 11: if isPrereleaseVersion(v) {
          Dmitri Shuralyov . resolved

          This is a tiny nit. Consider naming this `isPrereleaseOrDevelVersion`, since it is in fact checking for development versions too, but its current name doesn't make that very visible.

          Ian Alexander

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dmitri Shuralyov
          Submit Requirements:
          • requirement satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
          Gerrit-Change-Number: 720480
          Gerrit-PatchSet: 12
          Gerrit-Owner: Ian Alexander <ji...@google.com>
          Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
          Gerrit-Reviewer: Ian Alexander <ji...@google.com>
          Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
          Gerrit-Reviewer: Michael Matloob <mat...@google.com>
          Gerrit-Attention: Dmitri Shuralyov <dmit...@golang.org>
          Gerrit-Comment-Date: Sat, 22 Nov 2025 01:25:21 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Dmitri Shuralyov <dmit...@golang.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Ian Alexander (Gerrit)

          unread,
          Nov 21, 2025, 9:00:35 PM11/21/25
          to goph...@pubsubhelper.golang.org, Go LUCI, Dmitri Shuralyov, Michael Matloob, Michael Matloob, golang-co...@googlegroups.com
          Attention needed from Dmitri Shuralyov and Ian Alexander

          Ian Alexander voted Commit-Queue+1

          Commit-Queue+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dmitri Shuralyov
          • Ian Alexander
          Submit Requirements:
          • requirement satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
          Gerrit-Change-Number: 720480
          Gerrit-PatchSet: 12
          Gerrit-Owner: Ian Alexander <ji...@google.com>
          Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
          Gerrit-Reviewer: Ian Alexander <ji...@google.com>
          Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
          Gerrit-Reviewer: Michael Matloob <mat...@google.com>
          Gerrit-Attention: Ian Alexander <ji...@google.com>
          Gerrit-Attention: Dmitri Shuralyov <dmit...@golang.org>
          Gerrit-Comment-Date: Sat, 22 Nov 2025 02:00:31 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Ian Alexander (Gerrit)

          unread,
          Nov 21, 2025, 9:46:27 PM11/21/25
          to goph...@pubsubhelper.golang.org, Go LUCI, Dmitri Shuralyov, Michael Matloob, Michael Matloob, golang-co...@googlegroups.com
          Attention needed from Dmitri Shuralyov

          Ian Alexander voted Commit-Queue+1

          Commit-Queue+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dmitri Shuralyov
          Submit Requirements:
          • requirement satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
          Gerrit-Change-Number: 720480
          Gerrit-PatchSet: 12
          Gerrit-Owner: Ian Alexander <ji...@google.com>
          Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
          Gerrit-Reviewer: Ian Alexander <ji...@google.com>
          Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
          Gerrit-Reviewer: Michael Matloob <mat...@google.com>
          Gerrit-Attention: Dmitri Shuralyov <dmit...@golang.org>
          Gerrit-Comment-Date: Sat, 22 Nov 2025 02:46:22 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Dmitri Shuralyov (Gerrit)

          unread,
          Nov 21, 2025, 10:20:22 PM11/21/25
          to Ian Alexander, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Matloob, Michael Matloob, golang-co...@googlegroups.com
          Attention needed from Ian Alexander

          Dmitri Shuralyov voted and added 1 comment

          Votes added by Dmitri Shuralyov

          Code-Review+1
          TryBot-Bypass+1

          1 comment

          Patchset-level comments
          File-level comment, Patchset 12 (Latest):
          Dmitri Shuralyov . resolved

          The trybot failures seem unrelated to this change, and each trybot passed just not all at the same time, so it should be safe to bypass in this case.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ian Alexander
          Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
            Gerrit-Change-Number: 720480
            Gerrit-PatchSet: 12
            Gerrit-Owner: Ian Alexander <ji...@google.com>
            Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
            Gerrit-Reviewer: Ian Alexander <ji...@google.com>
            Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
            Gerrit-Reviewer: Michael Matloob <mat...@google.com>
            Gerrit-Attention: Ian Alexander <ji...@google.com>
            Gerrit-Comment-Date: Sat, 22 Nov 2025 03:20:19 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Ian Alexander (Gerrit)

            unread,
            Nov 21, 2025, 10:21:03 PM11/21/25
            to goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Matloob, Michael Matloob, golang-co...@googlegroups.com
            Attention needed from Ian Alexander

            Ian Alexander voted Commit-Queue+1

            Commit-Queue+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Ian Alexander
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
            Gerrit-Change-Number: 720480
            Gerrit-PatchSet: 12
            Gerrit-Owner: Ian Alexander <ji...@google.com>
            Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
            Gerrit-Reviewer: Ian Alexander <ji...@google.com>
            Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
            Gerrit-Reviewer: Michael Matloob <mat...@google.com>
            Gerrit-Attention: Ian Alexander <ji...@google.com>
            Gerrit-Comment-Date: Sat, 22 Nov 2025 03:21:00 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Ian Alexander (Gerrit)

            unread,
            Nov 22, 2025, 9:12:31 AM11/22/25
            to goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Matloob, Michael Matloob, golang-co...@googlegroups.com

            Ian Alexander voted Commit-Queue+1

            Commit-Queue+1
            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
            Gerrit-Change-Number: 720480
            Gerrit-PatchSet: 12
            Gerrit-Owner: Ian Alexander <ji...@google.com>
            Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
            Gerrit-Reviewer: Ian Alexander <ji...@google.com>
            Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
            Gerrit-Reviewer: Michael Matloob <mat...@google.com>
            Gerrit-Comment-Date: Sat, 22 Nov 2025 14:12:27 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Ian Alexander (Gerrit)

            unread,
            Nov 22, 2025, 9:13:28 AM11/22/25
            to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Dmitri Shuralyov, Go LUCI, Michael Matloob, Michael Matloob, golang-co...@googlegroups.com

            Ian Alexander submitted the change with unreviewed changes

            Unreviewed changes

            10 is the latest approved patch-set.
            The change was submitted with unreviewed changes in the following files:

            ```
            The name of the file: src/cmd/go/internal/modload/init.go
            Insertions: 2, Deletions: 2.

            @@ -2262,7 +2262,7 @@
            // Candidate M) or a development version of Go 1.N, default to go 1.(N-2).0
            func DefaultModInitGoVersion() string {
            v := gover.Local()
            - if isPrereleaseVersion(v) {
            + if isPrereleaseOrDevelVersion(v) {
            v = gover.Prev(gover.Prev(v))
            } else {
            v = gover.Prev(v)
            @@ -2273,7 +2273,7 @@
            return v
            }

            -func isPrereleaseVersion(s string) bool {
            +func isPrereleaseOrDevelVersion(s string) bool {
            v := igover.Parse(s)
            return v.Kind != "" || v.Patch == ""
            }
            ```
            ```
            The name of the file: src/cmd/go/testdata/script/work_init_path.txt
            Insertions: 1, Deletions: 1.

            @@ -16,7 +16,7 @@

            -- go.mod --
            module example
            -go 1.18.0
            +go 1.18
            -- dir/go.mod --
            module example
            go 1.21.0
            ```

            Change information

            Commit message:
            cmd/go: update default go directive in mod or work init

            This commit updates the default go directive when initializing a new
            module.

            The current logic is to use the latest version supported by the
            toolchain. This behavior is simple, predictable, and importantly, it
            can work while completely offline (i.e., no internet connection
            required).

            This commit changes the default version to the following behavior:

            * If the current toolchain version is a stable version of Go 1.N.M,
            default to go 1.(N-1).0
            * If the current toolchain version is a pre-release version of Go
            1.N (Release Candidate M) or a development version of Go 1.N, default
            to go 1.(N-2).0

            This behavior maintains the property of being able to work offline.

            Fixes #74748.
            Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
            Commit-Queue: Ian Alexander <ji...@google.com>
            Reviewed-by: Dmitri Shuralyov <dmit...@golang.org>
            TryBot-Bypass: Dmitri Shuralyov <dmit...@golang.org>
            Reviewed-by: Michael Matloob <mat...@golang.org>
            Reviewed-by: Michael Matloob <mat...@google.com>
            Files:
            • M src/cmd/go/internal/modload/init.go
            • M src/cmd/go/internal/workcmd/init.go
            • M src/cmd/go/testdata/script/mod_edit.txt
            • A src/cmd/go/testdata/script/mod_init_version.txt
            • M src/cmd/go/testdata/script/work.txt
            • M src/cmd/go/testdata/script/work_edit.txt
            • M src/cmd/go/testdata/script/work_init_path.txt
            • M src/cmd/go/testdata/script/work_init_toolchain.txt
            • A src/cmd/go/testdata/script/work_init_version.txt
            • M src/cmd/go/testdata/script/work_sync_toolchain.txt
            • M src/cmd/go/testdata/script/work_use_toolchain.txt
            Change size: M
            Delta: 11 files changed, 171 insertions(+), 60 deletions(-)
            Branch: refs/heads/master
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Dmitri Shuralyov, +1 by Michael Matloob, +2 by Michael Matloob
            • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI, TryBot-Bypass+1 by Dmitri Shuralyov
            Open in Gerrit
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: merged
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
            Gerrit-Change-Number: 720480
            Gerrit-PatchSet: 13
            open
            diffy
            satisfied_requirement

            Michael Matloob (Gerrit)

            unread,
            4:35 PM (2 hours ago) 4:35 PM
            to Ian Alexander, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Matloob, golang-co...@googlegroups.com

            Michael Matloob has created a revert of this change

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: revert
            satisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages