x/tools/gopls: How to use //go:build sometag #54317
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
I read a lot of issues. There seems to be no solution?
gopls version
go env
What did you do?
This case from conditional-compilation-with-build-tags
What did you expect to see?
I hope to fix this error message when I used
//go:build !alt
What did you see instead?
vscode error:
No packages found for open file /go/src/my-practice/my/foo_alt.go: <nil>. If this file contains build tags, try adding "-tags=<build tag>" to your gopls "buildFlags" configuration (see (https://github.com/golang/tools/blob/master/gopls/doc/settings.md#buildflags-string). Otherwise, see the troubleshooting guidelines for help investigating (https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md).
Editor and settings
in project:
default settings:
The text was updated successfully, but these errors were encountered: