1
0
mirror of https://github.com/golang/go synced 2024-09-30 12:18:33 -06:00

gopls: add note to vscode doc about tags

As prompted [this issue](https://github.com/golang/go/issues/38963) it
is unclear how to setup build tags in gopls in vscode.

vscode has a configuration section specific for go build tags but it is
not honored by gopls which instead requires GOFLAGS environment variable
to be set with the -tags flag.

Change-Id: Ib74a5bca78bf222d73224590ee0344948f020f9f
GitHub-Last-Rev: 37d1f9f625f13b5917f983cdd0b1b2a36968457e
GitHub-Pull-Request: golang/tools#227
Reviewed-on: https://go-review.googlesource.com/c/tools/+/233018
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Horacio Duran 2020-05-08 20:55:23 +00:00 committed by Rebecca Stambler
parent 9b82503631
commit 2d0106b2df

View File

@ -52,6 +52,16 @@ See the section on [command line](command-line.md) arguments for more informatio
You can disable features through the `"go.languageServerExperimentalFeatures"` section of the config. An example of a feature you may want to disable is `"documentLink"`, which opens [`pkg.go.dev`](https://pkg.go.dev) links when you click on import statements in your file.
### Build tags
build tags will not be picked from `go.buildTags` configuration section, instead they should be specified as part of the`GOFLAGS` environment variable:
```json5
"go.toolsEnvVars": {
"GOFLAGS": "-tags=<yourtag>"
}
```
[VSCode-Go]: https://github.com/microsoft/vscode-go