From 2d0106b2df1a7870dd5c4e4cfa03ace628630152 Mon Sep 17 00:00:00 2001 From: Horacio Duran Date: Fri, 8 May 2020 20:55:23 +0000 Subject: [PATCH] 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 --- gopls/doc/vscode.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gopls/doc/vscode.md b/gopls/doc/vscode.md index f0aff81245..60c196e79f 100644 --- a/gopls/doc/vscode.md +++ b/gopls/doc/vscode.md @@ -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=" +} +``` + [VSCode-Go]: https://github.com/microsoft/vscode-go