Skip to content
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

runtime: Version() string should be more easily discernible #11972

Closed
griesemer opened this issue Jul 31, 2015 · 1 comment
Closed

runtime: Version() string should be more easily discernible #11972

griesemer opened this issue Jul 31, 2015 · 1 comment
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Jul 31, 2015

runtime.Version() prints something like

devel +226b28c Fri Jul 31 18:49:57 2015 +0000

at tip, and, if at a release, something like

go1.4.2

There's no easy way to determine which version is younger or older. Tests in external repos sometimes need to be able to distinguish against which version of the std lib they are running; typically they require a certain "minimal" version.

There could be a runtime.VersionNumber() that returns some form of monotonically increasing value/string; or perhaps runtime.VersionTime() could return a value that is easily converted into a time.Time. Alternatively, runtime.Version() could always start with the most recent version, followed by the current version hash if not at a release. That would at least make it possible to discern against tagged releases. For instance:

go1.4.2

means we are at the tagged release 1.4.2.

go1.4.2 devel +226b28c Fri Jul 31 18:49:57 2015 +0000

would mean we are at devel +226b28c past 1.4.2, and 1.4.2 is the most recent tagged release.

Another alternative would be to have a time stamp always.

@seankhliao
Copy link
Contributor

@seankhliao seankhliao commented Nov 17, 2021

This was done in CL 264938

Loading

@seankhliao seankhliao closed this Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants