vscode-go icon indicating copy to clipboard operation
vscode-go copied to clipboard

Upgrade direct dependencies in combination with the go tool directive:

Open hu3bi opened this issue 9 months ago • 5 comments

Is your feature request related to a problem? Please describe.

When clicking "Upgrade direct dependencies", VS Code pulls in several unnecessary (tool) dependencies, which are removed after running go mod tidy. This behavior may be confusing, especially for new Go developers. Describe the solution you'd like I would prefer the same outcome as running go get -u all

Or vscode could just keep the behavior as it is and run go mod tidy afterward

Additional context https://github.com/golang/go/issues/71663

hu3bi avatar Mar 06 '25 09:03 hu3bi

Hi hu3bi,

Thanks for reporting this issue. The code lens is reported from gopls, see documentation.

Behind the scene, its running go get -d ..... from command.go.

I'm not expert of go binary, maybe @samthanawalla can share thoughts or concerns see if this is ok to change the implementations.

h9jiang avatar Mar 06 '25 19:03 h9jiang

cc: @matloob

ansaba avatar Mar 06 '25 20:03 ansaba

Based on the discussion, I think we can do a go mod tidy after upgrade dependency.

Or consider running go get -u ./... behind the scene.

h9jiang avatar Mar 06 '25 21:03 h9jiang

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

gopherbot avatar Apr 06 '25 19:04 gopherbot

I should remove the waiting for info tag. This is a FR.

h9jiang avatar Apr 07 '25 13:04 h9jiang