-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
Proposal Details
I've seen people break their project with a go get -u in various forums. It does seem that the main culprits for leaving projects in a broken state are either due to v0 packages or unversioned packages.
Currently https://go.dev/blog/publishing-go-modules#v0-the-initial-unstable-version recommends making breaking changes on v0 via bumping the minor release; and non-breaking changes via bumping patch release. For v1 and above, the breaking changes are indicated via bumping major release.
go get -u bumps the minor&patch release, which is only safe to do on v1+ packages based on the recommendations.
My proposal is to make go get -u default behaviour for v0 packages only to bump patch release. That way go get -u would become less problematic.
If the old behaviour is still desirable, something like go get -u=minor can be used.
At the moment I'm unable to think of any significant downsides with this approach; other than go get -u not bumping minor releases on golang.org/x packages. And of course go get -u logic becoming more complex.
Related issues:
- Pinning certain versions cmd/go: add option to prevent 'go get -u' from updating certain dependencies #29968
- Mentions a similar issue cmd/go: go get -u should not upgrade to unstable version #51922
Metadata
Metadata
Assignees
Labels
Type
Projects
Status