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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: advice for the warning of "You are neither in a module nor in your GOPATH" #38979

Open
wondar-chan opened this issue May 10, 2020 · 3 comments

Comments

@wondar-chan
Copy link

@wondar-chan wondar-chan commented May 10, 2020

i actually use "go mod init appname" to generate a go.mod, but the vocode go extention still warns me that "You are neither in a module nor in your GOPATH"

@PaluMacil
Copy link

@PaluMacil PaluMacil commented May 10, 2020

EDIT I stand corrected, but my original incorrect reply was this:

This is the issue tracker for the language runtime and not where the vscode package is maintained. Microsoft maintains the extension and it's hosted at microsoft/vscode-go. I can still advise: exit and reload. The way the vs code extension works, it doesn't recheck for your module file after you make it, so you are seeing an error that's out of date. The command Go: Restart Language Server (hit F1 to enter) might also recheck for module mode.

@stamblerre stamblerre changed the title advice for the warning of "You are neither in a module nor in your GOPATH" x/tools/gopls: advice for the warning of "You are neither in a module nor in your GOPATH" May 10, 2020
@gopherbot gopherbot added this to the Unreleased milestone May 10, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 May 10, 2020
@gopherbot gopherbot added the Tools label May 10, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented May 10, 2020

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added the gopls label May 10, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented May 10, 2020

gopls should actually handle the creation of a go.mod file. @wondar-chan: What is the root directory that you have open in VS Code? It has to be the one that contains the go.mod file or a subdirectory.

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
4 participants
You can’t perform that action at this time.