diff --git a/core/utils/version.go b/core/utils/version.go index 656ac335..bcd35667 100644 --- a/core/utils/version.go +++ b/core/utils/version.go @@ -5,37 +5,6 @@ import ( "strings" ) -// returns -1 if the first version is lower than the second, 0 if they are equal, and 1 if the second is lower. -func CompareVersions(a, b string) int { - as := strings.Split(a, ".") - bs := strings.Split(b, ".") - var loop int - if len(as) > len(bs) { - loop = len(as) - } else { - loop = len(bs) - } - - for i := 0; i < loop; i++ { - var x, y string - if len(as) > i { - x = as[i] - } - if len(bs) > i { - y = bs[i] - } - xi, _ := strconv.Atoi(x) - yi, _ := strconv.Atoi(y) - if xi > yi { - return 1 - } else if xi < yi { - return -1 - } - } - - return 0 -} - //return 0 if they are equal,and 1 if v1>2,and 2 if v1