From 281050ffddd88206d068f5f9e9cfa31cf01c9446 Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Mon, 11 Oct 2021 16:22:21 -0700 Subject: [PATCH] _content: change 'go get' to 'go install' where appropriate For golang/go#43684 Change-Id: Ifdb0695d15961150960f7be3eb0fb44ac1f0d4d2 Reviewed-on: https://go-review.googlesource.com/c/website/+/355249 Trust: Jay Conrod Run-TryBot: Jay Conrod TryBot-Result: Go Bot Reviewed-by: Bryan C. Mills --- _content/dl.tmpl | 2 +- _content/doc/go-get-install-deprecation.md | 6 +++--- _content/doc/index.html | 2 +- _content/doc/install/source.html | 16 +++------------- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/_content/dl.tmpl b/_content/dl.tmpl index 6e236699..c018d3aa 100644 --- a/_content/dl.tmpl +++ b/_content/dl.tmpl @@ -103,7 +103,7 @@ $(document).ready(function() {

This is an unstable version of Go. Use with caution.

If you already have Go installed, you can install this version by running:

-go get golang.org/dl/{{.Version}}
+go install golang.org/dl/{{.Version}}@latest
 

Then, use the {{.Version}} command instead of the go command to use {{.Version}}.

{{end}} diff --git a/_content/doc/go-get-install-deprecation.md b/_content/doc/go-get-install-deprecation.md index 6161d475..8f05de85 100644 --- a/_content/doc/go-get-install-deprecation.md +++ b/_content/doc/go-get-install-deprecation.md @@ -8,9 +8,9 @@ Starting in Go 1.17, installing executables with `go get` is deprecated. `go install` may be used instead. -In a future Go release, `go get` will no longer build packages; it will only +In Go 1.18, `go get` will no longer build packages; it will only be used to add, update, or remove dependencies in `go.mod`. Specifically, -`go get` will act as if the `-d` flag were enabled. +`go get` will always act as if the `-d` flag were enabled. ## What to use instead @@ -40,7 +40,7 @@ In order to avoid ambiguity, when `go install` is used with a version suffix, all arguments must refer to `main` packages in the same module at the same version. If that module has a `go.mod` file, it must not contain directives like `replace` or `exclude` that would cause it to be interpreted differently if it -were the main module. +were the main module. The module's `vendor` directory is not used. See [`go install`](/ref/mod#go-install) for details. diff --git a/_content/doc/index.html b/_content/doc/index.html index 3dce8cd0..8c6e34f9 100644 --- a/_content/doc/index.html +++ b/_content/doc/index.html @@ -195,7 +195,7 @@ A major version update can be very disruptive to your module's users because it

Publishing a module

-When you want to make a module available for other developers, you publish it so that it's visible to Go tools. Once you've published the module, developers importing its packages will be able to resolve a dependency on the module by running commands such as go get. +When you want to make a module available for other developers, you publish it so that it's visible to Go tools. Once you've published the module, developers importing its packages will be able to resolve a dependency on the module by running commands such as go get.

Module version numbering

diff --git a/_content/doc/install/source.html b/_content/doc/install/source.html index 4fff34fb..8bbe4960 100644 --- a/_content/doc/install/source.html +++ b/_content/doc/install/source.html @@ -398,19 +398,9 @@ To install one of the tools (godoc in this case):

-$ go get golang.org/x/tools/cmd/godoc
+$ go install golang.org/x/tools/cmd/godoc@latest
 
-

-To install these tools, the go get command requires -that Git be installed locally. -

- -

-You must also have a workspace (GOPATH) set up; -see How to Write Go Code for the details. -

-

Community resources

@@ -504,8 +494,8 @@ you must set GOPATH to another location to avoid conflicts.

The directory where executables outside the Go distribution are installed using the go command. For example, -go get golang.org/x/tools/cmd/godoc downloads, builds, and -installs $GOBIN/godoc. By default, $GOBIN is +go install golang.org/x/tools/cmd/godoc@latest downloads, builds, +and installs $GOBIN/godoc. By default, $GOBIN is $GOPATH/bin (or $HOME/go/bin if GOPATH is not set). After installing, you will want to add this directory to your $PATH so you can use installed tools.