Skip to content

Commit c5188f2

Browse files
committed
gopls/doc/advanced.md: update unstable version installation instruction
`go get` no longer builds/installs binaries in tip. Updates golang/go#46880 Change-Id: I5673368a579d79f571adf5ca5c44c15b8101dbe9 Reviewed-on: https://go-review.googlesource.com/c/tools/+/354169 Trust: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]>
1 parent d477ef3 commit c5188f2

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

gopls/doc/advanced.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,17 @@ Where `vX.Y.Z` is the desired version.
1919
To update `gopls` to the latest **unstable** version, use:
2020

2121
```sh
22-
GO111MODULE=on go get golang.org/x/tools/gopls@master golang.org/x/tools@master
22+
# Create an empty go.mod file, only for tracking requirements.
23+
cd $(mktemp -d)
24+
go mod init gopls-unstable
25+
26+
# Use 'go get' to add requirements and to ensure they work together.
27+
go get golang.org/x/tools/gopls@master golang.org/x/tools@master
28+
29+
# For go1.17 or older, the above `go get` command will build and
30+
# install `gopls`. For go1.18+ or tip, run the following command to install
31+
# using selected versions in go.mod.
32+
go install golang.org/x/tools/gopls
2333
```
2434

2535
## Working on the Go source distribution
@@ -55,11 +65,11 @@ build gopls at tip. External APIs are under active development on the
5565
Go `master` branch, so building gopls at tip minimizes the chances of
5666
a build failure.
5767

58-
```
59-
$ GO111MODULE=on gotip get golang.org/x/tools/gopls@master golang.org/x/tools@master
60-
```
68+
Build and install the latest **unstable** version of `gopls` following
69+
[the instruction](#installing-unreleased-versions).
70+
Remember to use `gotip` instead of `go`.
6171

62-
This will build a version of gopls that understands generic code. To actually
72+
The `gopls` build with this instruction understands generic code. To actually
6373
run the generic code you develop, you must also use the tip version of the Go
6474
compiler. For example:
6575

0 commit comments

Comments
 (0)