]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: update `go help mod edit` with the tool and ignore sections
authorDaniel Martí <mvdan@mvdan.cc>
Sat, 30 Aug 2025 20:13:12 +0000 (21:13 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 2 Oct 2025 18:30:47 +0000 (11:30 -0700)
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>
src/cmd/go/alldocs.go
src/cmd/go/internal/modcmd/edit.go

index f1e1b1c333542cc239fa708b431da7ea29cc7b02..19b48f0579bb29b6800516e2596267d4643eb0a1 100644 (file)
 // 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
 //             Exclude   []Module
 //             Replace   []Replace
 //             Retract   []Retract
+//             Tool      []Tool
+//             Ignore    []Ignore
+//     }
+//
+//     type Module struct {
+//             Path    string
+//             Version string
 //     }
 //
 //     type ModPath struct {
index aafd9752a8e48766bd63db08b3de18f975421837..041b4432bfd4f0f48008cbe8c20d719d4821d9b5 100644 (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 {