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
Closed
Labels
Milestone

Comments

@marwan-at-work
Copy link
Contributor

@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: 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 label Apr 5, 2020
@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
@marwan-at-work
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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can鈥檛 perform that action at this time.