x/tools/gopls: gopls shows compilation error when "go build/test" works fine #38264
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
Hi there 馃憢
I'm running into an issue where a _test.go file is using a function defined in another _test.go file but vscode/gopls is showing an "undeclared name" error even though "go test" works just fine.
To reproduce:
clone the repository and open the following file from within VSCode: https://github.com/open-telemetry/opentelemetry-go/blob/e8546e3bc520b3cf20934cd92fc013d75bf87565/exporters/otlp/otlp_test.go
If the current master branch does not show an error, try to checkout the exact commit above.
Here's a screenshot of one of those functions and the error that I am seeing
However, when you run
go test
, the test compiles just fine.I tried to narrow down the issue by creating a smaller repository but I couldn't reproduce the error, so apologies for not being able to do so :)
cc: @stamblerre @heschik (thank you)
PS. I am building gopls with the latest commit
The text was updated successfully, but these errors were encountered: