]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: update go work edit -json types to final version
authorIan Lance Taylor <iant@golang.org>
Fri, 28 Jan 2022 23:17:46 +0000 (15:17 -0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 31 Jan 2022 22:55:32 +0000 (22:55 +0000)
For #45713

Change-Id: Ia55a96702b99cccaf5d96c2125ee513700658444
Reviewed-on: https://go-review.googlesource.com/c/go/+/381874
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Trust: Michael Matloob <matloob@golang.org>

src/cmd/go/alldocs.go
src/cmd/go/internal/workcmd/edit.go

index 826b0ccf19ce359c5235a3a7a81b069748caea68..9dd41a80789f9a58b875e0e6c1545a6ea07a1605 100644 (file)
 // The -json flag prints the final go.work 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 GoWork struct {
-//             Go        string
-//             Directory []Directory
-//             Replace   []Replace
+//             Go      string
+//             Use     []Use
+//             Replace []Replace
 //     }
 //
 //     type Use struct {
-//             Path       string
+//             DiskPath   string
 //             ModulePath string
 //     }
 //
 //             New Module
 //     }
 //
+//     type Module struct {
+//             Path    string
+//             Version string
+//     }
+//
 // See the workspaces design proposal at
 // https://go.googlesource.com/proposal/+/master/design/45713-workspace.md for
 // more information.
index c42000710e0f5c56d037288f164156d3d7b7e585..879ddc3b1deb2f84fbdb5f423772696e93a1c1c6 100644 (file)
@@ -63,19 +63,14 @@ writing it back to go.mod.
 The -json flag prints the final go.work 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 GoWork struct {
-               Go        string
-               Directory []Directory
-               Replace   []Replace
+               Go      string
+               Use     []Use
+               Replace []Replace
        }
 
        type Use struct {
-               Path       string
+               DiskPath   string
                ModulePath string
        }
 
@@ -84,6 +79,11 @@ writing it back to go.mod. The JSON output corresponds to these Go types:
                New Module
        }
 
+       type Module struct {
+               Path    string
+               Version string
+       }
+
 See the workspaces design proposal at
 https://go.googlesource.com/proposal/+/master/design/45713-workspace.md for
 more information.