Documentation
¶
Overview ¶
Package semverish orders version strings the way game mod loaders do: SMAPI's loose semantic versions (two to four numbers, an optional v, SMAPI's prerelease rules) and .NET's System.Version, which BepInEx 5 uses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Compare parses both strings and orders them as Version.Compare does. ok is false, and the order 0, when either does not parse.
func CompareDotNet ¶
CompareDotNet orders two versions the way .NET's System.Version does, which BepInEx 5 uses: two to four plain numbers, a part left out ranks below 0 (so 1.0 < 1.0.0), and anything else (a suffix, a leading v, one number) is not a version. ok is false, and the order 0, when either is not one.
Types ¶
type Version ¶
type Version struct {
Major, Minor, Patch int
// Platform is SMAPI's fourth number.
Platform int
// Pre and Build are written without their leading '-' and '+'. Build never affects order.
Pre, Build string
}
Version is a parsed version. Missing numbers are 0.
func Parse ¶
Parse reads a version: two to four numbers, an optional leading v or V, an optional -prerelease whose identifiers are separated by '.' or '-', and optional +build, with surrounding whitespace trimmed. Leading zeros are accepted.