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: when using in GOROOT, "gopls requires a module at the root of your workspace" #48022

jayconrod opened this issue Aug 27, 2021 · 1 comment


Copy link

@jayconrod jayconrod commented Aug 27, 2021

ATTENTION: Please answer these questions BEFORE submitting your issue. Thanks!

What did you do?

  • Add the following file in GOROOT:
go 1.18

directory (
  • Checkout a recent commit of Go. I was reviewing CL 345390, so this should get what I had:
git fetch refs/changes/90/345390/1 && git checkout FETCH_HEAD
  • Run make.bash, reload VSCode window (workspace root is GOROOT), open some files.
  • NOTE: this is my workspace settings.json, so I think gopls should be using cmd/go built in that GOROOT.
  "go.alternateTools": {
    "go": "/Users/jayconrod/Code/goroot/bin/go"

What did you expect to see?

No errors, everything working normally.

What did you see instead?

On the VSCode status bar, I see a spinning arrow animation with the error:

gopls requires a module at the root of your workspace.
You can work with multiple modules by opening each one as a workspace folder.
Improvements to this workflow will be coming soon, and you can learn more here:

I also see a red squiggly line with this error under the go directive in It also shows up on the package declaration in each .go file I open.

Build info v0.7.1 h1:Mh3Z8Xcoq3Zy7ksSlwDV/nzQSbjFf06A+L+F8YHq55U= h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= h1:ZC/gVBZl8poJyKzWLxxlsmhayVGosF4mohR35szD5Bg= h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE= h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA= h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
@gopherbot gopherbot added this to the Unreleased milestone Aug 27, 2021
Copy link
Contributor Author

@jayconrod jayconrod commented Aug 27, 2021

I normally see this error when working in GOROOT without, but gopls seems to work fine otherwise, so I ignore it and hide the status bar so the error animation doesn't distract me. I don't think this should happen with a file though.

@hyangah hyangah removed this from the Unreleased milestone Aug 30, 2021
@hyangah hyangah added this to the gopls/on-deck milestone Aug 30, 2021
@stamblerre stamblerre removed their assignment Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants