Documentation
¶
Index ¶
- Constants
- Variables
- func MaxLabel(a, b string) string
- type ByVersionDescending
- type SemVer
- func (s *SemVer) IncrementMajor()
- func (s *SemVer) IncrementMinor()
- func (s *SemVer) IncrementPatch()
- func (s SemVer) PreSuffix() (string, string)
- func (s *SemVer) Prefix(prefix string)
- func (s *SemVer) Presep(pre string)
- func (s SemVer) String() string
- func (s *SemVer) Suffix(suffix string)
- func (s *SemVer) Sufsep(suf string)
- func (s SemVer) Version() string
Constants ¶
View Source
const SEMVERRE = `(\d+)\.(\d+)\.(\d+)`
SEMVERRE is the semantic versioning regexp
View Source
const SEMVERRE_PRE_RE = `(.*)` + SEMVERRE
View Source
const SEMVERRE_SUF_RE = SEMVERRE + `(.*)`
Variables ¶
View Source
var ErrParsingError = errors.New("parsing error")
Functions ¶
Types ¶
type ByVersionDescending ¶
type ByVersionDescending []SemVer
ByVersionDescending sorts versions in descending order. Suffixes are parsed according to semver
func (ByVersionDescending) Len ¶
func (a ByVersionDescending) Len() int
func (ByVersionDescending) Less ¶
func (a ByVersionDescending) Less(i, j int) bool
func (ByVersionDescending) Swap ¶
func (a ByVersionDescending) Swap(i, j int)
type SemVer ¶
type SemVer struct {
// contains filtered or unexported fields
}
SemVer is a struct representing a semantic version
func ParseSeparated ¶
func (*SemVer) IncrementMajor ¶
func (s *SemVer) IncrementMajor()
IncrementMajor increments the major version and sets minor and patch to zero
func (*SemVer) IncrementMinor ¶
func (s *SemVer) IncrementMinor()
IncrementMinor increments the minor version and sets patch to zero
func (*SemVer) IncrementPatch ¶
func (s *SemVer) IncrementPatch()
IncrementPatch increments the patch version
Click to show internal directories.
Click to hide internal directories.