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: error loading workspace #54193
Comments
[Info - 09:32:24] 2022/08/03 09:32:23 falling back to safe trimming due to type errors: [/usr/lib/go/src/runtime/vdso_linux.go:53:38: invalid operation: division by zero /usr/lib/go/src/runtime/vdso_linux.go:54:38: invalid operation: division by zero] or still-missing identifiers: map[memRecordCycle:true pageBits:true] [Error - 09:32:24] 2022/08/03 09:32:24 errors loading workspace: You are outside of a module and outside of $GOPATH/src. Log from GO Language Server |
I updated GO to 1.19, seemed to have no effect. If you want to look more into this, please keep this. But for my part the issues is resolved by just not using the product. |
We would like to understand why this regressed for you. Not using gopls is going to lead to an inferior experience in many other ways. If I understand correctly, you are not in GOPATH, and do not have a go.mod file? If so, I am not sure how your build is working. Can you tell us any more information about the workspace? |
I do have a go.mod file and the project builds fine. I was not originally in GOPATH, but moving the project to GOPATH removed the error, but gopls did not find my modules, even though the project was building fine. However, after updating and re-installing all tools on GO 1.19 this seems to work fine now. |
Ok, thanks. If things are working now I'll close this. What do you mean exactly by "gopls did not find my modules": modules are defined by a go.mod file. |
##What version of Go are you using (go version)?
1.18.4-1
##What operating system and processor architecture are you using?
OS: Manjaro Linux x86_64
CPU: Intel i7-8650U (8) @ 4.200GHz
##What did you do?
Worked on a project on friday, updated my system before I left work. Including VSCode and GOlang.
##What did you expect to see?
No errors on my toolbar,
##What did you see instead?
When I open projects where I have imported modules from remote sources I get a red underline under the import line and a Problem report in the problems-tab.
The errors occurs after I open the folder from the dropdown menu.
Also accompanied by this message:
Error loading workspace: You are outside of a module and outside of $GOPATH/src. If you are using modules, please open your editor to a directory in your module. If you believe this warning is incorrect, please file an issue: https://github.com/golang/go/issues/new.
Which is true, I am not in that folder, but I have never worked in that folder and never had errors before. Moving my workspace to $GOPATH/src removes the message, but the problem reports and visual red underlines on the import statements are still present.
I have no errors compiling the programs, so this is a bug in Visual Studio.
The text was updated successfully, but these errors were encountered: