diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-03-16 14:15:45 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-03-16 14:15:45 +0000 |
commit | cd3c7908c2ca750b27d330b4d257edc6818c4a5d (patch) | |
tree | 194d7b0e539d014393564a256bec571e18d6533a /gopls/doc/advanced.md | |
parent | 3225eca48f7ce16eb31b2dd5a170806c1214a49e (diff) | |
parent | 09c5a32afc5b66f28f166a68afe1fc71afbf9b73 (diff) | |
download | golang-x-tools-build-tools-release.tar.gz |
Snap for 9757917 from 09c5a32afc5b66f28f166a68afe1fc71afbf9b73 to build-tools-releasebuild-tools-release
Change-Id: If48e809642d94de846f47e34b88e446095e21aa5
Diffstat (limited to 'gopls/doc/advanced.md')
-rw-r--r-- | gopls/doc/advanced.md | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/gopls/doc/advanced.md b/gopls/doc/advanced.md index c4e9eabef..9f9267c1c 100644 --- a/gopls/doc/advanced.md +++ b/gopls/doc/advanced.md @@ -44,42 +44,26 @@ editor. ## Working with generic code -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 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: +Gopls has support for editing generic Go code. To enable this support, you need +to **install gopls using Go 1.18 or later**. The easiest way to do this is by +[installing Go 1.18+](https://go.dev/dl) and then using this Go version to +install gopls: ``` -$ go1.18beta2 install golang.org/x/tools/gopls@latest +$ go 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: +It is strongly recommended that you install the latest version of `gopls`, or +the latest **unstable** version as [described above](#installing-unreleased-versions). +We're still working on improving our generics support. -``` -$ go1.18beta2 run . -``` +The `gopls` built with these instructions understands generic code. See the +[generics tutorial](https://go.dev/doc/tutorial/generics) for more information +on how to use generics in Go! ### 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 |