mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-09-25 01:10:30 +00:00
platform: Fix version compare
This commit is contained in:
@@ -3,6 +3,8 @@ package libbox
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/sagernet/sing-box/common/badversion"
|
||||
|
||||
"golang.org/x/mod/semver"
|
||||
)
|
||||
|
||||
@@ -15,7 +17,7 @@ func CompareSemver(left string, right string) bool {
|
||||
if !semver.IsValid(normalizedRight) {
|
||||
return false
|
||||
}
|
||||
return semver.Compare(normalizedLeft, normalizedRight) > 0
|
||||
return badversion.Parse(normalizedLeft).GreaterThan(badversion.Parse(normalizedRight))
|
||||
}
|
||||
|
||||
func normalizeSemver(version string) string {
|
||||
|
||||
Reference in New Issue
Block a user