Documentation
¶
Overview ¶
Package semver compares release versions well enough for lich's update checks: MAJOR.MINOR.PATCH plus the SemVer rules that a pre-release precedes the release it qualifies and that two pre-releases order identifier by identifier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPreRelease ¶ added in v0.93.0
IsPreRelease reports whether v is a pre-release lich tags, a release version followed by a label and its number (0.93.0-rc.15). The "-N-gSHA" that git describe emits between tags is not one.
func IsRelease ¶
IsRelease reports whether v is a MAJOR.MINOR.PATCH release version, with no pre-release suffix. A dev build ("dev", or the "-N-gSHA" that git describe emits between tags) is not a release, so the update check must not treat it as one. Build metadata ("+local.3") is ignored, as it carries no precedence (SemVer §10): a build of a release that only labels itself is that release, and is offered the next one.
func Less ¶
Less reports whether version a is strictly older than b. Missing or non-numeric components sort as 0, a pre-release sorts before the release it qualifies (SemVer §11: 1.0.0-rc1 < 1.0.0), and two pre-releases of the same version compare identifier by identifier (1.0.0-rc.2 < 1.0.0-rc.10).
Types ¶
This section is empty.