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

Closed
wondar-chan opened this issue May 10, 2020 · 4 comments
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@wondar-chan
Copy link

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 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 This label describes issues relating to any tools in the x/tools repository. label May 10, 2020
@gopherbot
Copy link

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 Issues related to the Go language server, gopls. label May 10, 2020
@stamblerre
Copy link
Contributor

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.

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label May 11, 2020
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v0.4.2 Jun 18, 2020
@golang golang locked and limited conversation to collaborators Jun 18, 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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants