[go] internal/workcmd: add toolchain to json output

2 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Nov 25, 2025, 8:03:59 AMNov 25
to goph...@pubsubhelper.golang.org, Etienne Audet, golang-co...@googlegroups.com

Gerrit Bot has uploaded the change for review

Commit message

internal/workcmd: add toolchain to json output

Fixes https://github.com/golang/go/issues/75941
Change-Id: I7e5be8ea18e771221c095ae5e98384c9ec19f25f
GitHub-Last-Rev: 9ba97342bfad4dd125ae41f9045f2fd383760d5c
GitHub-Pull-Request: golang/go#76459

Change diff

diff --git a/src/cmd/go/internal/workcmd/edit.go b/src/cmd/go/internal/workcmd/edit.go
index b18098ba..0783e36 100644
--- a/src/cmd/go/internal/workcmd/edit.go
+++ b/src/cmd/go/internal/workcmd/edit.go
@@ -352,6 +352,9 @@
for _, d := range workFile.Use {
f.Use = append(f.Use, useJSON{DiskPath: d.Path, ModPath: d.ModulePath})
}
+ if workFile.Toolchain != nil {
+ f.Toolchain = workFile.Toolchain.Name
+ }

for _, r := range workFile.Replace {
f.Replace = append(f.Replace, replaceJSON{r.Old, r.New})
@@ -366,9 +369,10 @@

// workfileJSON is the -json output data structure.
type workfileJSON struct {
- Go string `json:",omitempty"`
- Use []useJSON
- Replace []replaceJSON
+ Go string `json:",omitempty"`
+ Toolchain string `json:",omitempty"`
+ Use []useJSON
+ Replace []replaceJSON
}

type useJSON struct {

Change information

Files:
  • M src/cmd/go/internal/workcmd/edit.go
Change size: S
Delta: 1 file changed, 7 insertions(+), 3 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement 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: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I7e5be8ea18e771221c095ae5e98384c9ec19f25f
Gerrit-Change-Number: 724260
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Etienne Audet <etienne.au...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Gopher Robot (Gerrit)

unread,
Nov 25, 2025, 8:04:00 AMNov 25
to Etienne Audet, Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gopher Robot added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Gopher Robot . unresolved

I spotted some possible problems with your PR:

  1. Are you describing the change in complete sentences with correct punctuation in the commit message body, including ending sentences with periods?
2. You usually need to reference a bug number for all but trivial or cosmetic fixes. For this repo, the format is usually 'Fixes #12345' or 'Updates #12345' at the end of the commit message. Should you have a bug reference?

Please address any problems by updating the GitHub PR.

When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above. These findings are based on heuristics; if a finding does not apply, briefly reply here saying so.

To update the commit title or commit message body shown here in Gerrit, you must edit the GitHub PR title and PR description (the first comment) in the GitHub web interface using the 'Edit' button or 'Edit' menu entry there. Note: pushing a new commit to the PR will not automatically update the commit message used by Gerrit.

For more details, see:

(In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)

Open in Gerrit

Related details

Attention set is empty
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: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I7e5be8ea18e771221c095ae5e98384c9ec19f25f
    Gerrit-Change-Number: 724260
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Etienne Audet <etienne.au...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Comment-Date: Tue, 25 Nov 2025 13:03:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Gerrit Bot (Gerrit)

    unread,
    Nov 25, 2025, 8:22:07 AMNov 25
    to Etienne Audet, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Gerrit Bot uploaded new patchset

    Gerrit Bot uploaded patch set #2 to this change.
    Open in Gerrit

    Related details

    Attention set is empty
    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: I7e5be8ea18e771221c095ae5e98384c9ec19f25f
    Gerrit-Change-Number: 724260
    Gerrit-PatchSet: 2
    unsatisfied_requirement
    open
    diffy

    Etienne Audet (Gerrit)

    unread,
    Dec 28, 2025, 8:02:24 PM (8 hours ago) Dec 28
    to Gerrit Bot, goph...@pubsubhelper.golang.org, Gopher Robot, golang-co...@googlegroups.com

    Etienne Audet added 1 comment

    Patchset-level comments
    File-level comment, Patchset 1:
    Gopher Robot . resolved

    I spotted some possible problems with your PR:

      1. Are you describing the change in complete sentences with correct punctuation in the commit message body, including ending sentences with periods?
    2. You usually need to reference a bug number for all but trivial or cosmetic fixes. For this repo, the format is usually 'Fixes #12345' or 'Updates #12345' at the end of the commit message. Should you have a bug reference?

    Please address any problems by updating the GitHub PR.

    When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above. These findings are based on heuristics; if a finding does not apply, briefly reply here saying so.

    To update the commit title or commit message body shown here in Gerrit, you must edit the GitHub PR title and PR description (the first comment) in the GitHub web interface using the 'Edit' button or 'Edit' menu entry there. Note: pushing a new commit to the PR will not automatically update the commit message used by Gerrit.

    For more details, see:

    (In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)

    Etienne Audet

    Done

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement 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: I7e5be8ea18e771221c095ae5e98384c9ec19f25f
      Gerrit-Change-Number: 724260
      Gerrit-PatchSet: 2
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-CC: Etienne Audet <etienne.au...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Comment-Date: Mon, 29 Dec 2025 01:02:20 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Gopher Robot <go...@golang.org>
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Gerrit Bot (Gerrit)

      unread,
      Dec 28, 2025, 8:05:43 PM (8 hours ago) Dec 28
      to Etienne Audet, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Gerrit Bot uploaded new patchset

      Gerrit Bot uploaded patch set #3 to this change.
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement 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: I7e5be8ea18e771221c095ae5e98384c9ec19f25f
      Gerrit-Change-Number: 724260
      Gerrit-PatchSet: 3
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages