Skip to content

Commit c61f99f

Browse files
committed
cmd/getgo: create a module in preparation for deprecation
And add deprecation notice. Updates golang/go#60951 Change-Id: I9d4ffffc03201b038db5cc11563ea1cc5330e668 Reviewed-on: https://go-review.googlesource.com/c/tools/+/563398 Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 451218f commit c61f99f

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

cmd/getgo/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**Deprecated** - See https://go.dev/issues/60951
2+
13
# getgo
24

35
A proof-of-concept command-line installer for Go.

cmd/getgo/go.mod

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Deprecated: follow the installation instructions at go.dev/doc/install.
2+
module golang.org/x/tools/cmd/getgo
3+
4+
go 1.18

cmd/getgo/main.go

+21-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,25 @@
55
//go:build !plan9
66
// +build !plan9
77

8-
// The getgo command installs Go to the user's system.
8+
/*
9+
The getgo command is deprecated.
10+
11+
Deprecated: See https://go.dev/issues/60951.
12+
13+
Follow the instructions at https://go.dev/doc/install to install Go instead.
14+
15+
Tips:
16+
17+
To find the latest available go version, run:
18+
19+
go list -m -f '{{.Version}}' go@latest
20+
21+
If you want to use the latest go by default, you can use "go env -w" to override "GOTOOLCHAIN":
22+
23+
go env -w GOTOOLCHAIN=go$(go list -m -f '{{.Version}}' go@latest)+auto
24+
25+
See https://go.dev/blog/toolchain for more information about toolchain management.
26+
*/
927
package main
1028

1129
import (
@@ -32,6 +50,8 @@ var errExitCleanly error = errors.New("exit cleanly sentinel value")
3250

3351
func main() {
3452
flag.Parse()
53+
fmt.Fprintln(os.Stderr, "getgo is deprecated. See https://pkg.go.dev/golang.org/x/tools/cmd/getgo.")
54+
3555
if *goVersion != "" && !strings.HasPrefix(*goVersion, "go") {
3656
*goVersion = "go" + *goVersion
3757
}

0 commit comments

Comments
 (0)