-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: add option to prevent 'go get -u' from updating certain dependencies #29968
Comments
The |
It may be that we should resolve the cyclic dependency problem in some other way, such as having |
Finally, if there is a breaking change in a |
I don't have a good sense of the severity or frequency of these issues. As you point out, there are alternatives for all of them, but I'm not sure how often they're going to come up or how annoying they're going to be. Let's mark this as Unplanned and decide what to do after modules are on by default. I don't think this is a critical feature to have before then. |
I think the best fit for this use-case is a special version query. |
What are the chances that this might ever happen in some capacity? I'm in a scenario right now where I want to update all the dependencies in my |
@braydonk, today you can pass the version of the package or module that you want to keep to
|
Ah cool, I wasn't able to find that anywhere when I was looking around documentation or even blog posts. Thank you for the trick! |
I'd love to see this capability as well. On one codebase I'm working, we have 3 particular dependencies which introduce breaking changes, so cannot be updated. I'd love the option to do something like |
We should provide a way for users to prevent
go get -u
from updating certain dependencies unless they're explicitly requested.There are a number of reasons users may need to pin a module dependency to a lower version. For example:
v0
versions.When a user has a dependency that requires special care to update,
go get -u
is not safe to use on its own. Instead, one needs to build a list of all requirements, exclude modules that shouldn't be updated, then pass that list togo get -u
. This is cumbersome.Some ideas for improvements:
-except
or-exclude
flag, allowing users to specify modules that shouldn't be updated.go.mod
that tellsgo get -u
not to update a module unless it's specifically named on the command line.This is somewhat related to #28424.
The text was updated successfully, but these errors were encountered: