-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: unnecessary go.sum entries added after viewing Go files #61935
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
Could it be that I noticed that after upgrading a project to Go 1.21 and then running |
@spencerschrock this might be the source of changes to (emphasis mine)
|
I tried (locally) upgrading the project's If I leave the project at 1.19 and change my Go toolchain to 1.19 instead, the issue goes away. I tried a few more versions and the issue only starts when my Go toolchain is 1.20.5. |
With that info, and the 1.20.5 milestone, I'm guessing it's this issue: |
Thanks for investigating, @spencerschrock and @rhcarvalho. Do you think there is anything to be improved here from the gopls side? We'd prefer to keep things simple, given that go.sum requirements will (eventually) stabilize. |
I can follow #60748 for resolution. My only immediate thought is a local workaround, which will probably be me defining an alias for |
Hmm, thinking about this a bit more, I'm not sure why gopls is fighting with you. The only go commands gopls is running are |
FWIW, I'm skeptical that this is gopls at all. Looking at the log, no commands are being run, so go.sum shouldn't be changing regardless of any go command bugs. I suppose gopls could be buggy, but my money is on some linter or script doing it. Especially since I wasn't able to reproduce. |
The behavior went away when I turned off the language server(
Thanks for the data point. I requested a second cloud VM and was unable to reproduce there. Apologies for the lack of |
What did you do?
.go
fileWhat did you expect to see?
No changes to my
go.sum
file, as I haven't changed anything and the file was alreadygo mod tidy
'dWhat did you see instead?
125 insertions to
go.sum
that disappear when I rungo mod tidy
.Which is inconvenient when I try to change branches, as the uncommitted
go.sum
changes abort my checkout.Build info
Trace Output
Click to expand
Go/gopls extension settings
Occurs with default VS Code settings for Go and gopls
The text was updated successfully, but these errors were encountered: