Skip to content
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

Upgrade direct dependencies in combination with the go tool directive: #3706

Open
hu3bi opened this issue Mar 6, 2025 · 3 comments
Open
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@hu3bi
Copy link

hu3bi commented Mar 6, 2025

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
golang/go#71663

@h9jiang
Copy link
Member

h9jiang commented Mar 6, 2025

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 h9jiang added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 6, 2025
@ansaba
Copy link

ansaba commented Mar 6, 2025

cc: @matloob

@h9jiang
Copy link
Member

h9jiang commented Mar 6, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants