Skip to content

proposal: dl: add "latest patch version" runner #29984

Closed
@SamWhited

Description

@SamWhited

In CI it would be convenient to have a way to easily download the latest patch version of some minor version of Go and setup the correct PATH without having to specify a specific patch version that would need to be bumped in the CI config every time Go was released. I would like to propose that this be added to the go-gettable packages at golang.org/dl using ".x" for the patch version.
For example, running:

go get -u golang.org/dl/go1.11.x

would install a new binary called go1.11.x alongside existing versions such as go1.11.5 and gotip.

I see two possible ways to implement this:

Adding support for ".x" versions to dl/internal/version and then generating a .x version as necessary.
When a ".x" version is run, it would scan ~/sdk for any versions of Go that start with "go1.11" (or whatever the prefix was), pick the latest one, and run that.
When go1.11.x download is run, it would download and parse https://storage.googleapis.com/go-builder-data/dl-index.txt and compare the versions there to whatever is in the ~/sdk directory at the moment. If there is a newer one it would download it to the correct location for that specific version (eg. ~/sdk/go1.11.5).

Alternatively, when genv command could be updated to always generate a go1.major.x version whenever it is run that corresponds to the latest version in the tree (eg. internally it would be hard coded to a specific version, just the name would include ".x"). Each time it is rerun, this packages hard coded version would be bumped and the user would have to go get -u the .x version over again to bump the binary to the latest version, then possibly run go download again to download the distribution to the ~/sdk tree.

EDIT: actually, the builder index doesn't appear to be up to date and https://golang.org/dl/?mode=json only contains the latest two supported versions. We'd have to find somewhere else to get version information or fix the builder data.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions