Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: gopls shows compilation error when "go build/test" works fine #38264

Closed
marwan-at-work opened this issue Apr 5, 2020 · 1 comment
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

Comments

@marwan-at-work
Copy link
Contributor

marwan-at-work commented Apr 5, 2020

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

Screen Shot 2020-04-05 at 5 06 49 PM

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

@marwan-at-work marwan-at-work added the gopls Issues related to the Go language server, gopls. label Apr 5, 2020
@gopherbot gopherbot added this to the Unreleased milestone Apr 5, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Apr 5, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 Apr 5, 2020
@marwan-at-work
Copy link
Contributor Author

marwan-at-work commented Apr 5, 2020

Nevermind, I missed that there was a go.mod file in the otlp folder, so I needed to open another vscode window. Closing the issue :)

@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v0.4.1 May 13, 2020
@golang golang locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.
Projects
None yet
Development

No branches or pull requests

3 participants