Подготовить HY2XS к production-сборке

This commit is contained in:
2026-04-25 23:13:12 +05:00
commit 84a4e94567
277 changed files with 26513 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
package util
import "strings"
func CompareVersion(version1, version2 string) int {
v1 := strings.Split(version1, ".")
v2 := strings.Split(version2, ".")
// Compare major version numbers
if v1[0] > v2[0] {
return 1
} else if v1[0] < v2[0] {
return -1
}
// If the major version numbers are the same, compare the minor version numbers
if len(v1) > 1 && len(v2) > 1 {
if v1[1] > v2[1] {
return 1
} else if v1[1] < v2[1] {
return -1
}
}
// If the major and minor versions are the same, compare the revision numbers
if len(v1) > 2 && len(v2) > 2 {
if v1[2] > v2[2] {
return 1
} else if v1[2] < v2[2] {
return -1
}
}
// The version number is exactly the same
return 0
}