Documentation ¶
Index ¶
- func Canonical(v string) (canonical string, err error)
- func CanonicalWithGoPrefix(v string) (canonical string, err error)
- func SanitiseVersionMajor(version string) (majorMinor string, err error)
- func SanitiseVersionMajorMinor(version string) (majorMinor string, err error)
- func TrimGoPrefix(v string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Canonical ¶
Canonical will return the canonical form of the version with the .MAJOR .MINOR and .PATCH whilst discarding build information It will return an error if the version is not valid semver (unlike Canonical() in golang.org/x/mod/semver) Use CanonicalWithGoPrefix() if you want the 'v' prefix for compatibility with golang.org/x/mod/semver
func CanonicalWithGoPrefix ¶
CanonicalWithGoPrefix will return the canonical form of the version with the .MAJOR .MINOR and .PATCH whilst discarding build information It will return an error if the version is not valid semver (unlike Canonical() in golang.org/x/mod/semver) It will prepend 'v' if necessary for compatibility with 'golang.org/x/mod/semver'. Use Canonical() if you don't want the 'v' prefix
func SanitiseVersionMajor ¶
SanitiseVersionMajor will return the major part of the version with the 'v' prefix
func SanitiseVersionMajorMinor ¶
SanitiseVersionMajor will return the major and minor parts of the version with the 'v' prefix
func TrimGoPrefix ¶
TrimGoPrefix will trim the 'v' prefix from a string
Types ¶
This section is empty.