Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: Version() string should be more easily discernible #11972
runtime.Version() prints something like
at tip, and, if at a release, something like
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:
means we are at the tagged release 1.4.2.
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.