-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: go get -u yields a different result compared to go get on a clean go.mod #38362
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
Note that the indirect requirement in |
As far as I can tell, this is working as designed and documented (in https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them). |
Note in particular that |
The documentation says:
and
So, it is only https://golang.org/cmd/go/#hdr-Maintaining_module_requirements says:
This is probably the reason for the added indirect requirement, but I'm not sure I fully understand the reason. Thanks |
Within the Go command documentation, the phrase “dependencies” generally means “transitive dependencies”, not “immediate dependencies”. The only difference between |
If |
Seems like this is working. Maybe the documentation isn't clear on the implications though?
|
Closing. Doesn't seem like there's anything to do here. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have a module that requires
After invoking
go clean -modcache
,go get -u
andgo mod tidy
, the diff is:I found that indirect requirement in the
go.mod
file suspicious, so I removed thego.mod
andgo.sum
files, and invokedgo mod init
andgo get
. The new diff is:Having different results is probably not the correct behavior.
Thanks
The text was updated successfully, but these errors were encountered: