diff options
Diffstat (limited to 'vendor/github.com/mcuadros')
-rw-r--r-- | vendor/github.com/mcuadros/go-version/README.md | 4 | ||||
-rw-r--r-- | vendor/github.com/mcuadros/go-version/compare.go | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/vendor/github.com/mcuadros/go-version/README.md b/vendor/github.com/mcuadros/go-version/README.md index b6addcd0e7..a64c0a68d9 100644 --- a/vendor/github.com/mcuadros/go-version/README.md +++ b/vendor/github.com/mcuadros/go-version/README.md @@ -1,4 +1,4 @@ -go-version [![Build Status](https://travis-ci.org/mcuadros/go-version.png?branch=master)](https://travis-ci.org/mcuadros/go-version) [![GoDoc](https://godoc.org/github.com/mcuadros/go-version?status.png)](http://godoc.org/github.com/mcuadros/go-version) +go-version [![Build Status](https://travis-ci.org/mcuadros/go-version.svg?branch=master)](https://travis-ci.org/mcuadros/go-version) [![GoDoc](https://godoc.org/github.com/mcuadros/go-version?status.svg)](http://godoc.org/github.com/mcuadros/go-version) ============================== Version normalizer and comparison library for go, heavy based on PHP version_compare function and Version comparsion libs from [Composer](https://github.com/composer/composer) PHP project @@ -78,5 +78,3 @@ License ------- MIT, see [LICENSE](LICENSE) - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/mcuadros/go-version/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/vendor/github.com/mcuadros/go-version/compare.go b/vendor/github.com/mcuadros/go-version/compare.go index 84dc3fa1ff..98e14fa8ec 100644 --- a/vendor/github.com/mcuadros/go-version/compare.go +++ b/vendor/github.com/mcuadros/go-version/compare.go @@ -23,6 +23,8 @@ var specialForms = map[string]int{ "pl": 1, } +var unknownForm int = -7 + // Compares two version number strings, for a particular relationship // // Usage @@ -155,5 +157,15 @@ func numVersion(value string) int { return special } - return -7 + return unknownForm +} + +func ValidSimpleVersionFormat(value string) bool { + normalized := Normalize(value) + for _, component := range prepVersion(normalized) { + if numVersion(component) == unknownForm { + return false + } + } + return true } |