]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix 'go help mod edit' JSON documentation
authorJay Conrod <jayconrod@google.com>
Mon, 12 Apr 2021 18:50:57 +0000 (14:50 -0400)
committerJay Conrod <jayconrod@google.com>
Tue, 13 Apr 2021 13:51:17 +0000 (13:51 +0000)
The object representing a module directive may have a "Deprecated"
field but not a "Version" field. Other objects representing module
versions have "Path" and "Version" fields but not "Deprecated".

For #40357

Change-Id: Iad8063dfa6f7ceea22981a8a8f99e65fa3b7ffa0
Reviewed-on: https://go-review.googlesource.com/c/go/+/309337
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/modcmd/edit.go

index a713428bc24affb22f9a2d06e57850640c54dce4..66e78bb1ace8fcf1c6cccd19235c76cddc42ad9a 100644 (file)
 // writing it back to go.mod. The JSON output corresponds to these Go types:
 //
 //     type Module struct {
-//             Path string
-//             Deprecated string
+//             Path    string
+//             Version string
 //     }
 //
 //     type GoMod struct {
-//             Module  Module
+//             Module  ModPath
 //             Go      string
 //             Require []Require
 //             Exclude []Module
 //             Retract []Retract
 //     }
 //
+//     type ModPath struct {
+//             Path       string
+//             Deprecated string
+//     }
+//
 //     type Require struct {
 //             Path string
 //             Version string
index e1ec088f5577ae67f9313a1cc023d9726b874048..79a93ca44b916edbd91bd169542caa5f0434bb89 100644 (file)
@@ -85,12 +85,12 @@ 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
-               Deprecated string
+               Path    string
+               Version string
        }
 
        type GoMod struct {
-               Module  Module
+               Module  ModPath
                Go      string
                Require []Require
                Exclude []Module
@@ -98,6 +98,11 @@ writing it back to go.mod. The JSON output corresponds to these Go types:
                Retract []Retract
        }
 
+       type ModPath struct {
+               Path       string
+               Deprecated string
+       }
+
        type Require struct {
                Path string
                Version string