Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: provide an easy way to fetch the "latest" commit version from the default branch #29761
As described in
Sometimes it's useful to check the availability of the latest untagged version
Since it's hasn't been mentioned yet in this issue yet, I want to make the following observation.
For repositories that are known to be git,
For example, consider the https://github.com/rsc/go-get-default-branch repository, which has
I don't know whether this is intended and supported, or just incidental, but it works in
/cc @heschik FYI.
@dmitshur Correct, the go command works as you described and picks up the latest commit from the default branch when there are no tags in the repository. That's the behavior inherited from GOPATH mode.
Once the repo starts getting tags that can be interpreted as semver or module mode tags, the default is one of the tagged version. This feature request is about exposing the functionality to pick up the latest pseudo-version easily.
@dmitshur corrected me offline -