From: Ian Lance Taylor Date: Fri, 28 Jan 2022 23:17:46 +0000 (-0800) Subject: cmd/go: update go work edit -json types to final version X-Git-Tag: go1.18rc1~140 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d3f5cf9d285d39258b2e6f9002c44aaab3e77c42;p=gostls13.git cmd/go: update go work edit -json types to final version For #45713 Change-Id: Ia55a96702b99cccaf5d96c2125ee513700658444 Reviewed-on: https://go-review.googlesource.com/c/go/+/381874 Trust: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Michael Matloob Trust: Michael Matloob --- diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 826b0ccf19..9dd41a8078 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1472,19 +1472,14 @@ // 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 // } // @@ -1493,6 +1488,11 @@ // 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. diff --git a/src/cmd/go/internal/workcmd/edit.go b/src/cmd/go/internal/workcmd/edit.go index c42000710e..879ddc3b1d 100644 --- a/src/cmd/go/internal/workcmd/edit.go +++ b/src/cmd/go/internal/workcmd/edit.go @@ -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.