Documentation
¶
Overview ¶
Package semantic provides version parsing and comparison for various ecosystems, matching the native versioning rules of each ecosystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidVersion = errors.New("invalid version")
ErrInvalidVersion is returned for malformed version strings.
View Source
var ErrUnsupportedEcosystem = errors.New("unsupported ecosystem")
ErrUnsupportedEcosystem is returned for unsupported ecosystems.
Functions ¶
This section is empty.
Types ¶
type Version ¶
type Version interface {
// CompareStr returns an integer representing the sort order of the given string
// when parsed as the concrete Version relative to the subject Version.
//
// The result will be 0 if v == w, -1 if v < w, or +1 if v > w.
//
// An error is returned if the given string is not a valid Version, with "valid"
// being dependent on the underlying ecosystem of the concrete Version.
CompareStr(str string) (int, error)
}
Version provides an interface for sortable version strings.
Click to show internal directories.
Click to hide internal directories.