Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type SemVer ¶
type SemVer struct {
Major uint16
Minor uint16
Patch uint16
HasMinor bool
HasPatch bool
Prefix byte
Suffix string
}
func NewEmptySemVer ¶
func NewEmptySemVer() SemVer
NewEmptySemVer returns a zeroed SemVer with minor and patch components marked as present.
func ParseSemVer ¶
ParseSemVer parses input into a SemVer. An optional v prefix is accepted and a suffix is only allowed when allowSuffix is true.
func (SemVer) Compare ¶
Compare compares semantic-version precedence. Prefixes, missing zero components and build metadata do not affect precedence.
func (SemVer) HigherThan ¶
HigherThan reports whether s has higher precedence than b.
func (SemVer) MajorString ¶ added in v1.0.1
MajorString returns the major component, with the v prefix when present and no minor or patch components.
func (*SemVer) SetMajorMinorOnly ¶ added in v1.0.1
func (s *SemVer) SetMajorMinorOnly()
SetMajorMinorOnly truncates the version to its major and minor components, clearing patch and suffix.
func (*SemVer) SetMajorOnly ¶ added in v1.0.1
func (s *SemVer) SetMajorOnly()
SetMajorOnly truncates the version to its major component, clearing minor, patch and suffix.