From b484961fa2c7a22f6482034c617c4533069bb285 Mon Sep 17 00:00:00 2001 From: Peter Weinbergr Date: Sun, 6 Sep 2020 08:42:34 -0400 Subject: [PATCH] x/gools/gopls: document settings for working on source distribution Gopls needs to use the right go command to work properly on a source distribution. One way of getting this done is by setting go.alternateTools. Fixes golang/go#38603 Change-Id: Ie379b372c48f651a22c73d93f8608194c5e3a417 Reviewed-on: https://go-review.googlesource.com/c/tools/+/253297 Run-TryBot: Peter Weinberger TryBot-Result: Gobot Gobot Reviewed-by: Rebecca Stambler --- gopls/doc/user.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gopls/doc/user.md b/gopls/doc/user.md index db10c2d062..4f2f06fb45 100644 --- a/gopls/doc/user.md +++ b/gopls/doc/user.md @@ -130,6 +130,20 @@ supported within symbol queries: | `^` | `^printf` | exact prefix | | `$` | `printf$` | exact suffix | +### Working on the Go source distribution + +If you are working on the [Go project](https://go.googlesource.com/go) itself, your `go` command will have to correspond to the version of the source you are working on. That is, if you have downloaded the code to `$HOME/go`, your `go` command should be the `$HOME/go/bin/go` executable that you built with `make.bash` or equivalent. + +You can achieve this by adding the right version of `go` to your `PATH` (`export PATH=$HOME/go/bin:$PATH` on Unix systems) or by configuring your editor. In VS Code, you can use the `go.alternateTools` setting to point to the correct version of `go`: + +```json5 +{ + + "go.alternateTools": { + "go": "$HOME/bin/go" + } +} +``` ## Command line support