Skip to content

Commit

Permalink
doc: update the instruction to use beta2
Browse files Browse the repository at this point in the history
And include the link to the milestone and a known issue

Change-Id: Iaae07cdf1a533da44fd15e0692b29e4173ed879f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/381016
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
  • Loading branch information
hyangah committed Jan 31, 2022
1 parent 939c2c0 commit 492cf3a
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions gopls/doc/advanced.md
Expand Up @@ -50,26 +50,38 @@ Gopls has beta support for editing generic Go code, as defined by the type
parameters proposal ([golang/go#43651](https://golang.org/issues/43651)) and
type set addendum ([golang/go#45346](https://golang.org/issues/45346)).

To enable this support, you need to build gopls with a version of Go that
supports generics. The easiest way to do this is by installing Go 1.18 Beta
1 as described at
To enable this support, you need to **build gopls with a version of Go that
supports generics**. The easiest way to do this is by installing the Go 1.18 Beta
as described at
[Tutorial: Getting started with generics#prerequisites](https://go.dev/doc/tutorial/generics),
and then using this Go version to build gopls:

```
$ go1.18beta1 install golang.org/x/tools/gopls@latest
$ go1.18beta2 install golang.org/x/tools/gopls@latest
```

When using the Go 1.18, it is strongly recommended that you install the latest
version of `gopls`, or the latest **unstable** version as
[described above](#installing-unreleased-versions).

You also need to make `gopls` select the beta version of `go` (in `<GOROOT>/go/bin`
where GOROOT is the location reported by `go1.18beta2 env GOROOT`) by adding
it to your `PATH` or by configuring your editor.

The `gopls` built with these instructions understands generic code. To actually
run the generic code you develop, you must also use the beta version of the Go
compiler. For example:

```
$ go1.18beta1 run .
$ go1.18beta2 run .
```

### Known issues

* [`staticcheck`](https://github.com/golang/tools/blob/master/gopls/doc/settings.md#staticcheck-bool)
on generic code is not supported yet.

please follow the [v0.8.0](https://github.com/golang/go/milestone/244) milestone
to see the list of go1.18-related known issues and our progress.

[Go project]: https://go.googlesource.com/go

0 comments on commit 492cf3a

Please sign in to comment.