[go] cmd/go: update `go help mod edit` with the tool and ignore sections

2 views
Skip to first unread message

Daniel Martí (Gerrit)

unread,
Aug 30, 2025, 4:14:37 PMAug 30
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Daniel Martí has uploaded the change for review

Commit message

cmd/go: update `go help mod edit` with the tool and ignore sections

The types were added to the docs, but not the fields in GoMod.
While here, I was initially confused about what is the top-level type
given that `type Module` comes first. Move `type GoMod` to the top
as it is the actual top-level type.
Change-Id: I1270154837501f5c7f5b21959b2841fd4ac808d0

Change diff

diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go
index f1e1b1c..19b48f0 100644
--- a/src/cmd/go/alldocs.go
+++ b/src/cmd/go/alldocs.go
@@ -1280,11 +1280,6 @@
// The -json flag prints the final go.mod file in JSON format instead of
// writing it back to go.mod. The JSON output corresponds to these Go types:
//
-// type Module struct {
-// Path string
-// Version string
-// }
-//
// type GoMod struct {
// Module ModPath
// Go string
@@ -1294,6 +1289,13 @@
// Exclude []Module
// Replace []Replace
// Retract []Retract
+// Tool []Tool
+// Ignore []Ignore
+// }
+//
+// type Module struct {
+// Path string
+// Version string
// }
//
// type ModPath struct {
diff --git a/src/cmd/go/internal/modcmd/edit.go b/src/cmd/go/internal/modcmd/edit.go
index aafd975..041b443 100644
--- a/src/cmd/go/internal/modcmd/edit.go
+++ b/src/cmd/go/internal/modcmd/edit.go
@@ -104,11 +104,6 @@
The -json flag prints the final go.mod file in JSON format instead of
writing it back to go.mod. The JSON output corresponds to these Go types:

- type Module struct {
- Path string
- Version string
- }
-
type GoMod struct {
Module ModPath
Go string
@@ -118,6 +113,13 @@
Exclude []Module
Replace []Replace
Retract []Retract
+ Tool []Tool
+ Ignore []Ignore
+ }
+
+ type Module struct {
+ Path string
+ Version string
}

type ModPath struct {

Change information

Files:
  • M src/cmd/go/alldocs.go
  • M src/cmd/go/internal/modcmd/edit.go
Change size: S
Delta: 2 files changed, 14 insertions(+), 10 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: I1270154837501f5c7f5b21959b2841fd4ac808d0
Gerrit-Change-Number: 700116
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Martí <mv...@mvdan.cc>
Gerrit-Reviewer: Daniel Martí <mv...@mvdan.cc>
unsatisfied_requirement
satisfied_requirement
open
diffy

Daniel Martí (Gerrit)

unread,
Oct 1, 2025, 9:50:46 AM (19 hours ago) Oct 1
to goph...@pubsubhelper.golang.org, Go LUCI, Michael Matloob, Sam Thanawalla, golang-co...@googlegroups.com
Attention needed from Michael Matloob and Sam Thanawalla

Daniel Martí added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Daniel Martí . resolved

Friendly nudge.

Open in Gerrit

Related details

Attention is currently required from:
  • Michael Matloob
  • Sam Thanawalla
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: I1270154837501f5c7f5b21959b2841fd4ac808d0
    Gerrit-Change-Number: 700116
    Gerrit-PatchSet: 1
    Gerrit-Owner: Daniel Martí <mv...@mvdan.cc>
    Gerrit-Reviewer: Daniel Martí <mv...@mvdan.cc>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
    Gerrit-Comment-Date: Wed, 01 Oct 2025 13:50:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Sean Liao (Gerrit)

    unread,
    Oct 1, 2025, 6:10:18 PM (10 hours ago) Oct 1
    to Daniel Martí, goph...@pubsubhelper.golang.org, Ian Alexander, Go LUCI, Michael Matloob, golang-co...@googlegroups.com
    Attention needed from Daniel Martí, Ian Alexander and Michael Matloob

    Sean Liao voted Code-Review+2

    Code-Review+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Martí
    • Ian Alexander
    • Michael Matloob
    Submit Requirements:
    • requirement 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: I1270154837501f5c7f5b21959b2841fd4ac808d0
    Gerrit-Change-Number: 700116
    Gerrit-PatchSet: 1
    Gerrit-Owner: Daniel Martí <mv...@mvdan.cc>
    Gerrit-Reviewer: Daniel Martí <mv...@mvdan.cc>
    Gerrit-Reviewer: Ian Alexander <ji...@google.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Sean Liao <se...@liao.dev>
    Gerrit-Attention: Ian Alexander <ji...@google.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Attention: Daniel Martí <mv...@mvdan.cc>
    Gerrit-Comment-Date: Wed, 01 Oct 2025 22:10:10 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Matloob (Gerrit)

    unread,
    Oct 1, 2025, 6:36:37 PM (10 hours ago) Oct 1
    to Daniel Martí, goph...@pubsubhelper.golang.org, Ian Alexander, Go LUCI, golang-co...@googlegroups.com
    Attention needed from Daniel Martí and Ian Alexander

    Michael Matloob voted Code-Review+2

    Code-Review+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Martí
    • Ian Alexander
    Submit Requirements:
    • requirement 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: I1270154837501f5c7f5b21959b2841fd4ac808d0
    Gerrit-Change-Number: 700116
    Gerrit-PatchSet: 1
    Gerrit-Owner: Daniel Martí <mv...@mvdan.cc>
    Gerrit-Reviewer: Daniel Martí <mv...@mvdan.cc>
    Gerrit-Reviewer: Ian Alexander <ji...@google.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Sean Liao <se...@liao.dev>
    Gerrit-Attention: Ian Alexander <ji...@google.com>
    Gerrit-Attention: Daniel Martí <mv...@mvdan.cc>
    Gerrit-Comment-Date: Wed, 01 Oct 2025 22:36:33 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages