Skip to content

proposal: cmd/go: go get -u shouldn't bump minor release in v0 packages. #64864

@egonelbre

Description

@egonelbre

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Incoming

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions