aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/alldocs.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2023-05-22 12:26:15 -0400
committerRuss Cox <rsc@golang.org>2023-05-24 00:49:56 +0000
commit0c3015191f085fe4941da677d1a7787379bc57d9 (patch)
tree05cd7977c10b9f1f3e6b2d195cf61814f7f897a2 /src/cmd/go/alldocs.go
parente4d95d0de3c26d1cc5685e35cddb42657948057b (diff)
downloadgo-0c3015191f085fe4941da677d1a7787379bc57d9.tar.gz
go-0c3015191f085fe4941da677d1a7787379bc57d9.zip
cmd/go: add mod edit -toolchain and work edit -toolchain
We have added a new toolchain directive in go.mod and go.work. This CL adds support in mod edit and work edit for changing the toolchain line. For #57001. Change-Id: I36a960796630a359b8a587877cb9548c299d5c87 Reviewed-on: https://go-review.googlesource.com/c/go/+/497296 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/cmd/go/alldocs.go')
-rw-r--r--src/cmd/go/alldocs.go24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go
index 455a0f75363..6a1cb8b8103 100644
--- a/src/cmd/go/alldocs.go
+++ b/src/cmd/go/alldocs.go
@@ -1210,6 +1210,8 @@
//
// The -go=version flag sets the expected Go language version.
//
+// The -toolchain=name flag sets the Go toolchain to use.
+//
// The -print flag prints the final go.mod in its text format instead of
// writing it back to go.mod.
//
@@ -1222,12 +1224,13 @@
// }
//
// type GoMod struct {
-// Module ModPath
-// Go string
-// Require []Require
-// Exclude []Module
-// Replace []Replace
-// Retract []Retract
+// Module ModPath
+// Go string
+// Toolchain string
+// Require []Require
+// Exclude []Module
+// Replace []Replace
+// Retract []Retract
// }
//
// type ModPath struct {
@@ -1523,6 +1526,8 @@
//
// The -go=version flag sets the expected Go language version.
//
+// The -toolchain=name flag sets the Go toolchain to use.
+//
// The -print flag prints the final go.work in its text format instead of
// writing it back to go.mod.
//
@@ -1530,9 +1535,10 @@
// writing it back to go.mod. The JSON output corresponds to these Go types:
//
// type GoWork struct {
-// Go string
-// Use []Use
-// Replace []Replace
+// Go string
+// Toolchain string
+// Use []Use
+// Replace []Replace
// }
//
// type Use struct {