From: Daniel Martí Date: Sat, 30 Aug 2025 20:13:12 +0000 (+0100) Subject: cmd/go: update `go help mod edit` with the tool and ignore sections X-Git-Tag: go1.26rc1~727 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=707454b41f;p=gostls13.git 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 Reviewed-on: https://go-review.googlesource.com/c/go/+/700116 Reviewed-by: Sean Liao Reviewed-by: Carlos Amedee LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Matloob Reviewed-by: Junyang Shao --- diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index f1e1b1c333..19b48f0579 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 aafd9752a8..041b4432bf 100644 --- a/src/cmd/go/internal/modcmd/edit.go +++ b/src/cmd/go/internal/modcmd/edit.go @@ -104,11 +104,6 @@ writing it back to go.mod. 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 @@ writing it back to go.mod. The JSON output corresponds to these Go types: Exclude []Module Replace []Replace Retract []Retract + Tool []Tool + Ignore []Ignore + } + + type Module struct { + Path string + Version string } type ModPath struct {