Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Compare compare ver1 and ver2 by operation
For example:
Compare(ver1, Greater, ver2) is same as "ver1 > ver2"
Dirty versions and pre versions are regarded as standard version. For example: 'v5.1.2-dev' and 'v5.1.2-betav1' are regarded as 'v5.1.2'.
Latest or nightly version is larger than any version
func CompareByStr ¶
CompareByStr compare ver1 and ver2
For example:
CompareByStr(ver1, ">", ver2) is same as "ver1 > ver2"
Dirty versions and pre versions are regarded as standard version. For example: 'v5.1.2-dev' and 'v5.1.2-betav1' are regarded as 'v5.1.2'.
Latest or nightly version is larger than any version
Types ¶
type Constraint ¶
type Constraint struct {
// contains filtered or unexported fields
}
func NewConstraint ¶
func NewConstraint(op Operation, version string) (*Constraint, error)
func (*Constraint) Check ¶
func (c *Constraint) Check(version string) (bool, error)
Check tests if a version satisfies the constraints.
Dirty versions and pre versions are regarded as standard version. For example: 'v5.1.2-dev' and 'v5.1.2-betav1' are regarded as 'v5.1.2'.
Latest or nightly version is larger than any version