@@ -19,7 +19,17 @@ Where `vX.Y.Z` is the desired version.
19
19
To update ` gopls ` to the latest ** unstable** version, use:
20
20
21
21
``` 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
23
33
```
24
34
25
35
## Working on the Go source distribution
@@ -55,11 +65,11 @@ build gopls at tip. External APIs are under active development on the
55
65
Go ` master ` branch, so building gopls at tip minimizes the chances of
56
66
a build failure.
57
67
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 ` .
61
71
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
63
73
run the generic code you develop, you must also use the tip version of the Go
64
74
compiler. For example:
65
75
0 commit comments