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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/gopls: Unclared name same package different file #33693
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting section of the gopls Wiki page, and make sure that you have provided all of the relevant information here. |
Are you opening your editor from the directory that contains the |
#response_container_BBPPID{font-family: initial; font-size:initial; color: initial;} Yes Sebastian Malton From: notifications@github.comSent: August 16, 2019 5:11 PMTo: go@noreply.github.comReply to: reply@reply.github.comCc: sebastian@malton.name; author@noreply.github.comSubject: Re: [golang/go] x/tools/gopls: Unclared name same package different file (#33693) Are you opening your editor from the directory that contains the go.mod file?
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.
|
Please provide the output of |
|
Ok, so it looks like everything here is correct. What editor are you using? Can you provide |
I am using vscode:
Logs:
Even though if I run |
Can you try setting |
Having set that option and reloaded the Go plugin for vscode the output how has |
Can you share the full |
Logs
|
I tried reboot my computer (which didn't work) but then I just created a new workspace from scratch and it did work. So I would say that a fresh workspace after turning on GO111MODULES was the fix |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Create a file in a package, declare some public token say
func Foobar() {...}
. Declare a test file for that same file in the same package. Try and useFoobar()
.What did you expect to see?
No errors
What did you see instead?
undeclared name: FooBar
The text was updated successfully, but these errors were encountered: