From 7391fc19fa8ca7264473b0b5dfa13d83af7a9ad9 Mon Sep 17 00:00:00 2001 From: Dan Peterson Date: Sat, 21 Aug 2021 09:52:47 -0300 Subject: [PATCH] gopls/doc: update generic code section of advanced.md Since golang.org/cl/343732 was merged the dev.typeparams branch is no longer needed, just Go at tip. Change-Id: Ifb2e5220bc2f544d86cfa84d43d12d93e4e7fddb Reviewed-on: https://go-review.googlesource.com/c/tools/+/343967 Reviewed-by: Rebecca Stambler Trust: Rebecca Stambler Trust: Robert Findley Run-TryBot: Rebecca Stambler gopls-CI: kokoro TryBot-Result: Go Bot --- gopls/doc/advanced.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gopls/doc/advanced.md b/gopls/doc/advanced.md index 0fa1139247..da37494827 100644 --- a/gopls/doc/advanced.md +++ b/gopls/doc/advanced.md @@ -41,19 +41,18 @@ 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 type parameters: the -[dev.typeparams branch](https://github.com/golang/go/tree/dev.typeparams). This -can be done by checking out this branch in the Go repository, or by using +supports type parameters, currently just tip. This can be done by checking +out the `master` branch in the Go repository, or by using `golang.org/dl/gotip`: ``` $ go get golang.org/dl/gotip -$ gotip download dev.typeparams +$ gotip download ``` For building gopls with type parameter support, it is recommended that you build gopls at tip. External APIs are under active development on the -`dev.typeparams` branch, so building gopls at tip minimizes the chances of +Go `master` branch, so building gopls at tip minimizes the chances of a build failure (though it is still possible). To get enhanced gopls features for generic code, build gopls with the `typeparams` build constraint (though this increases your chances of a build failure). @@ -63,11 +62,11 @@ $ GO111MODULE=on gotip get -tags=typeparams golang.org/x/tools/gopls@master gola ``` This will build a version of gopls that understands generic code. To actually -run the generic code you develop, you must also tell the compiler to speak -generics using the `-G=3` compiler flag. For example +run the generic code you develop, you must also use the tip version of the Go +compiler. For example: ``` -$ gotip run -gcflags=-G=3 . +$ gotip run . ``` [Go project]: https://go.googlesource.com/go