Hey Golang-Nuts folks,

So I cloned the Go project from GitHub (github.com/golang/go) and tried to 
open it in Visual Studio Code with the Go extension. But I'm running into 
some pesky errors from gopls, and it's messing with the module detection.

When I open the root of the repo, I get this error message:

"Error loading workspace: gopls was not able to find modules in your 
workspace. When outside of GOPATH, gopls needs to know which modules you 
are working on. You can fix this by opening your workspace to a folder 
inside a Go module, or by using a go.work file to specify multiple modules. 
See the documentation for more information on setting up your workspace: 
https://github.com/golang/tools/blob/master/gopls/doc/workspace.md.";

However, when I open the 'src' directory in VSCode and make that the VSCode 
workspace root, I get a different gopls error:

"Error loading workspace: You have opened a nested module. To work on 
multiple modules at once, please use a go.work file. See 
https://github.com/golang/tools/blob/master/gopls/doc/workspace.md for more 
information on using workspaces."

Is there some other setup I need to do to make the Go project work with 
gopls? Any tips, tricks, or advice you can share would be super helpful.

Thanks in advance for any help!



-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d1eb103c-5d1b-4b46-9c4f-5edfdf901d95n%40googlegroups.com.

Reply via email to