Documentation
¶
Overview ¶
Package version exposes the semantic version of the installed grat binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Compare orders two grat versions the way semantic versioning does.
It returns a negative number where left names the older release, zero where both name the same one, and a positive number where left is the newer. Either may carry the v prefix or leave it out.
Anything that is not a semantic version orders below one that is, so a tag nobody can read never counts as newer than what is installed. That is the point of this function: grat replaces its own binary from whatever GitHub marks as the latest release, and comparing the two for equality alone installs an older one as readily as a newer one. Proving where a binary came from says nothing about its age.
func Current ¶
func Current() string
Current returns the version of the running grat for user-facing output.
A release build names its version through the linker. Without that, the Go build information carries the module version: the tag for go install with a version, and a pseudo-version for a build from a checkout, which the go command derives from version control. Either may omit the v prefix, which is added here.
Types ¶
This section is empty.