Documentation
¶
Index ¶
Constants ¶
const PRE = "devel"
PRE is the default pre-release identifier for development versions.
Variables ¶
var Error = errors.New("version")
Error represents a versioning error.
Functions ¶
func Compare ¶ added in v0.4.0
Compare returns an integer comparing two versions according to semantic version precedence. The result will be 0 if v == w, -1 if v < w, or +1 if v > w.
func Prerelease ¶
Prerelease extracts the pre-release part of a semantic version.
Types ¶
type Setting ¶ added in v0.4.1
type Setting Version
func (*Setting) MarshalSetting ¶ added in v0.4.1
MarshalSetting converts the String setting to a byte slice for storage or transmission.
func (*Setting) UnmarshalSetting ¶ added in v0.4.1
UnmarshalSetting updates the String setting from a byte slice, typically read from storage or received in a message.
type Version ¶
type Version string
Version is a semantic version string.
func Current ¶
func Current() Version
Current attempts to generate the closest realistic semantic version without requiring -ldflags, using Go module build info and Git fallbacks.