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

cmd/go: Make go get -u update existing packages, or add another flag #13332

Closed
zimmski opened this issue Nov 19, 2015 · 7 comments
Closed

cmd/go: Make go get -u update existing packages, or add another flag #13332

zimmski opened this issue Nov 19, 2015 · 7 comments

Comments

@zimmski
Copy link
Contributor

zimmski commented Nov 19, 2015

There is a constant stream (golang/lint#173, golang/lint#169, golang/lint#168, golang/lint#167, golang/lint#165 this list goes on and on) of user for golint that have outdated packages. This reports make it apparent that the -u flag of go get is kind of flawed. As the documentation for it states

By default, get uses the network to check out missing packages but does not use it to look for updates to existing packages.

The wording "by default" would suggest that there is another flag which does update existing packages but it seems that this is still missing.

I am happy to work on this, but would first like to discuss if this should be another flag, and if so, what its name should be.

@dsymonds
Copy link
Contributor

The golang/lint bugs are often due to the move of x/tools from code.google.com to github. There is, of course, a general class of problems here to do with the use of vanity import paths, but the specific case of the Go subrepos is a particularly notable instance of that class, and I wonder if it would be worth explicitly checking for them in go get even if we don't try to solve the general class.

@adg
Copy link
Contributor

adg commented Nov 19, 2015

The wording is "By default, get uses..." (emphasis mine).

The -u flag instructs get to use the network to update the named packages
and their dependencies. By default, get uses the network to check out
missing packages but does not use it to look for updates to existing packages.

So go get -u updates the named packages and their deps. go get without the flag just downloads missing packages.

@dsymonds
Copy link
Contributor

Note that it only updates the particular checkout of a package (e.g. approximately git pull); it doesn't "update" in the semantic sense if a vanity import path changes where it points.

@adg
Copy link
Contributor

adg commented Nov 20, 2015

@dsymonds hm, that seems like an oversight. We should probably print an error in that case.

@dominikh
Copy link
Member

Didn't f3a98de address the issue of vanity paths changing where they point?

@dsymonds
Copy link
Contributor

I'm guessing f3a98de only checked the named package, not its dependencies.

@rsc
Copy link
Contributor

rsc commented Dec 28, 2015

"go get -u" does update existing packages. Maybe there is something wrong with something else. If so, please file a separate bug.

@rsc rsc closed this as completed Dec 28, 2015
@golang golang locked and limited conversation to collaborators Dec 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants