update deps

This commit is contained in:
Andrey Nering
2017-07-15 13:34:42 -03:00
parent 769e25f080
commit 4ae9c2445d
32 changed files with 466 additions and 20 deletions

View File

@@ -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

View File

@@ -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
}