mirror of
https://github.com/go-task/task.git
synced 2026-06-30 08:04:28 +00:00
update deps
This commit is contained in:
5
vendor/github.com/Masterminds/semver/CHANGELOG.md
generated
vendored
5
vendor/github.com/Masterminds/semver/CHANGELOG.md
generated
vendored
@@ -1,3 +1,8 @@
|
||||
# 1.3.1 (2017-07-10)
|
||||
|
||||
## Fixed
|
||||
- Fixed #57: number comparisons in prerelease sometimes inaccurate
|
||||
|
||||
# 1.3.0 (2017-05-02)
|
||||
|
||||
## Added
|
||||
|
||||
23
vendor/github.com/Masterminds/semver/version.go
generated
vendored
23
vendor/github.com/Masterminds/semver/version.go
generated
vendored
@@ -394,8 +394,29 @@ func comparePrePart(s, o string) int {
|
||||
return -1
|
||||
}
|
||||
|
||||
if s > o {
|
||||
// When comparing strings "99" is greater than "103". To handle
|
||||
// cases like this we need to detect numbers and compare them.
|
||||
|
||||
oi, n1 := strconv.ParseInt(o, 10, 64)
|
||||
si, n2 := strconv.ParseInt(s, 10, 64)
|
||||
|
||||
// The case where both are strings compare the strings
|
||||
if n1 != nil && n2 != nil {
|
||||
if s > o {
|
||||
return 1
|
||||
}
|
||||
return -1
|
||||
} else if n1 != nil {
|
||||
// o is a string and s is a number
|
||||
return -1
|
||||
} else if n2 != nil {
|
||||
// s is a string and o is a number
|
||||
return 1
|
||||
}
|
||||
// Both are numbers
|
||||
if si > oi {
|
||||
return 1
|
||||
}
|
||||
return -1
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user