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: You are outside of a module and outside of $GOPATH/src #45015
Comments
|
Yes it is. $ ls -al /home/user/src/prj/functions/productoperations/getproduct/ Total 68 drwxrwxr-x 3 user user 4096 maalis 15 10:06 . drwxrwxr-x 12 user user 4096 maalis 15 10:22 .. -rw-rw-r-- 1 user user 729 maalis 15 10:06 build.go -rw-rw-r-- 1 user user 257 maalis 15 10:06 go.mod -rw-rw-r-- 1 user user 40374 maalis 15 10:06 go.sum -rw-rw-r-- 1 user user 5727 maalis 15 10:06 handler.go drwxrwxr-x 5 user user 4096 maalis 15 09:59 vendor $ cat /home/user/src/prj/functions/productoperations/getproduct/go.mod module gitlab.com/co/prj/functions/getproduct go 1.15 require ( github.com/go-kit/kit v0.10.0 github.com/google/uuid v1.2.0 gitlab.com/valid_line/pkg/productdboperations v0.0.0-20210312065413-42c581ce6655 ) $ go test ? gitlab.com/co/prj/functions/getproduct [no test files] |
It looks like you're opening the |
Yes there is no such problem.
The issue is reproducible if I open folder /home/user/src/prj/functions/productoperations/ in VS Code, there are also some other modules (/home/user/src/prj/functions/productoperations/createproduct/ etc). There is no any go.mod in /home/user/src/prj/functions/productoperations/ (and any upper - in .../prj, .../prj/functions). gopls is the only tool which has a problems with such folder setup, briefly it is a go project with git submodules. Also I can not remove that warning even if I would close all open files in VS Code, it still remains, seems the only way to remove it is to re-start VS Code. |
|
Thank you, I see now that it is an official way even in VS Code, so I have to add each project separately to workspace. It is not very user friendly, but I have to do this just once, so it is ok. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. (gopls 0.6.6 and gopls 0.6.7-pre.1)
What operating system and processor architecture are you using (
go env
)?go env
Outputgopls -v version
OutputVisual Studio Code version
OutputWhat did you do?
I just open .go file in Visual Studio Code (with Go extension).
What did you expect to see?
I do not see any strange warnings. Sometime ago (month?..) it worked fine, but I am not sure which version I had at that time.
What did you see instead?
I see a warning in statusbar "Error loading workspace: You are outside of a module and outside of $GOPATH/src" - which is too wide, it just prevents me to see the current line/column in the status bar + some other info there. If it would be possible just suppress this warning from showing in status bar even if it will be really there - it would be nice for me.
Screenshot and behaviour can be checked in the already closed #44363
gopls (server) logs
OutputThe text was updated successfully, but these errors were encountered: