aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/alldocs.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2023-06-04 22:34:52 -0400
committerRuss Cox <rsc@golang.org>2023-06-06 19:18:46 +0000
commit35268a996052ca8716caf94467c2ed61140f3862 (patch)
tree4e9b43b9f749a5ead6d098bb825a32c7d4e57219 /src/cmd/go/alldocs.go
parentbf016520e2575f8eb5e37634a4ed18c8c8044859 (diff)
downloadgo-35268a996052ca8716caf94467c2ed61140f3862.tar.gz
go-35268a996052ca8716caf94467c2ed61140f3862.zip
cmd/go: additional doc-inspired tests and bug fixes
Additional tests and bug fixes realized while writing go.dev/doc/gotoolchain (CL 500775). - Handle go get toolchain@go1.22 (resolve to latest patch release, same as go get go@1.22). (See modload/query.go and gover/mod.go.) - Handle go get go@patch toolchain@patch. (See modload/query.go and gover/mod.go.) - Remove prefix-goVERSION-suffix form for toolchain name, standardizing on goVERSION-suffix. I have no good explanation for having two forms, so simplify to one. (See vendor and gover.) - Fail toolchain downloads when GOSUMDB=off. Because toolchain downloads cannot always be predicted (especially during switching rather than selection), they cannot be listed in go.sum. We rely on the checksum database for integrity of the download, especially if proxied. If the checksum database is disabled, this integrity check won't happen, so fail toolchain downloads. (See modfetch/sumdb.go and script/gotoolchain_net.txt) - Use names from documentation in package toolchain (Select, Switch; SwitchTo renamed to Exec to avoid both names; reqs.go renamed to switch.go; toolchain.go renamed to select.go.) - Make "go env GOTOOLCHAIN" and "go env -w GOTOOLCHAIN" work even when GOTOOLCHAIN is misconfigured. (See special case at top of Select in select.go.) - Clarify what goInstallVersion does (report whether this is go install or go run pkg@version) and explain the potential version switch more clearly. Use the Switcher directly instead of reimplementing it. (See select.go.) - Document go@ and toolchain@ forms in go help get, linking to go.dev/doc/toolchain. (See modget/get.go.) - Update URL of documentation in $GOROOT/go.env. For #57001. Change-Id: I895ef3519ff95db8710ed23b36ebaf4f648120cb Reviewed-on: https://go-review.googlesource.com/c/go/+/500797 Reviewed-by: Michael Matloob <matloob@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Bypass: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/cmd/go/alldocs.go')
-rw-r--r--src/cmd/go/alldocs.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go
index 7ef763d6be..05ee094ea7 100644
--- a/src/cmd/go/alldocs.go
+++ b/src/cmd/go/alldocs.go
@@ -671,6 +671,14 @@
//
// go get example.com/mod@none
//
+// To upgrade the minimum required Go version to the latest released Go version:
+//
+// go get go@latest
+//
+// To upgrade the Go toolchain to the latest patch release of the current Go toolchain:
+//
+// go get toolchain@patch
+//
// See https://golang.org/ref/mod#go-get for details.
//
// In earlier versions of Go, 'go get' was used to build and install packages.
@@ -705,6 +713,9 @@
//
// For more about modules, see https://golang.org/ref/mod.
//
+// For more about using 'go get' to update the minimum Go version and
+// suggested Go toolchain, see https://go.dev/doc/toolchain.
+//
// For more about specifying packages, see 'go help packages'.
//
// This text describes the behavior of get using modules to manage source