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

marwan-at-work opened this issue Apr 5, 2020 · 1 comment


Copy link

@marwan-at-work 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:

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

@gopherbot gopherbot added this to the Unreleased milestone Apr 5, 2020
@gopherbot gopherbot added the Tools label Apr 5, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 Apr 5, 2020
Copy link
Contributor Author

@marwan-at-work 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.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants