-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: Error loading workspace: go: updates to go.mod needed, disabled by -mod=readonly : packages.Load error #44085
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
Comments
If you navigate to the Problems pane in VS Code or open your We have also been working on improving the error message, and I believe that will be addressed in an upcoming release. |
@stamblerre , I am seeing this error after upgrading to gopls My VS code settings for gopls are: "gopls": {
"build.experimentalWorkspaceModule": true,
"build.expandWorkspaceToModule": true
} When I click on the light bulb and try to apply the suggested fix - which is to run I have run The |
@samstride: Do you minding file a new issue so that we can discuss this separately? Also, please attach a |
@stamblerre , sure can do, however I am facing the exact same error message so do you want me to use a specific title for the new issue? |
Any title is fine--you can also use the same title as this issue. |
The problems pane is empty and there is no indication, which go.mod has the problem (which made it so confusing). As with @samstride the error indicator in the status line keeps spinning.
If you think it's fixed then happy to close here. |
I would not expect the Problems pane to be empty, so that's definitely still an issue. Can you please share your |
Good morning :) Here we go: gopls.txt.zip |
Looks like the issue is in the
Do you still not see diagnostics on the If not, it looks like that module is public--would you be willing to create a branch with a repro case for us to continue investigating? |
Restarted vscode. This time, no spinner/error in status bar but message in problems view.
No, gone. I'm wondering if the "sticky" errors are similar to #43821? Let's ignore that aspect and wait for go 1.16. Now I'm getting output in the problem view. I still see an error there for a different module, however there's no fix available: The problematic module here is outside the workspace (one level higher). Looking into this and running
Long story short: I should not do this. I've moved the code from the parent folder to new and separate testing folder. Shall we close here? |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Load workspace, modules used. One
go.mod
created for quick testing is this:What did you expect to see?
No gopls error and an error message that can be diagnosed and re-tried on command line.
What did you see instead?
It would also be great if gopls didn't fail as it should not update the go.mod.
I'm also unsure how to invoke the command to reproduce the error, the notation in the gopls log might be clearer:
The text was updated successfully, but these errors were encountered: