diff options
author | Unknwon <u@gogs.io> | 2019-10-23 23:03:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-23 23:03:17 -0700 |
commit | 613139e7bef81d3573e7988a47eb6765f3de347a (patch) | |
tree | 49de7277898d3ff47a122c072568edb8ed4c9ac9 /vendor/github.com/mcuadros/go-version/constraint.go | |
parent | fb100dbf98f02e4c631d142ff0f52ec29ee2f00c (diff) |
Enable Go modules (#5835)
* Remove vendor
* Enable Go modules
* ci: add command to fetch dependencies
* ci: update setting
* ci: update settings
* Require Go 1.11
* Rename module name to gogs.io/gogs
Diffstat (limited to 'vendor/github.com/mcuadros/go-version/constraint.go')
-rw-r--r-- | vendor/github.com/mcuadros/go-version/constraint.go | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/vendor/github.com/mcuadros/go-version/constraint.go b/vendor/github.com/mcuadros/go-version/constraint.go deleted file mode 100644 index 8dc2cfcc..00000000 --- a/vendor/github.com/mcuadros/go-version/constraint.go +++ /dev/null @@ -1,49 +0,0 @@ -package version - -import ( - "strings" -) - -type Constraint struct { - operator string - version string -} - -// Return a new Constrain and sets operator and version to compare -func NewConstrain(operator, version string) *Constraint { - constraint := new(Constraint) - constraint.SetOperator(operator) - constraint.SetVersion(version) - - return constraint -} - -// Sets operator to compare -func (self *Constraint) SetOperator(operator string) { - self.operator = operator -} - -// Get operator to compare -func (self *Constraint) GetOperator() string { - return self.operator -} - -// Sets version to compare -func (self *Constraint) SetVersion(version string) { - self.version = version -} - -// Get version to compare -func (self *Constraint) GetVersion() string { - return self.version -} - -// Match a given version againts the constraint -func (self *Constraint) Match(version string) bool { - return Compare(version, self.version, self.operator) -} - -// Return a string representation -func (self *Constraint) String() string { - return strings.Trim(self.operator+" "+self.version, " ") -} |