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 <sean@liao.dev>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
This commit is contained in:
Daniel Martí 2025-08-30 21:13:12 +01:00
parent 8c68a1c1ab
commit 707454b41f
2 changed files with 14 additions and 10 deletions

View file

@ -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 {

View file

@ -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 {