Update common.go

pull/4926/head
xqzr 2025-07-23 19:42:53 +08:00 committed by GitHub
parent b67caa3840
commit 3318b0d8f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -358,12 +358,10 @@ func ParseRangeString(str string) (int, int, error) {
return 0, 0, nil
}
// for range value, like "114-514"
var pair []string
var pair []string = strings.SplitN(str, "-", 2)
// Process sth like "-114-514" "-1919--810"
if strings.HasPrefix(str, "-") {
pair = splitFromSecondDash(str)
} else {
pair = strings.SplitN(str, "-", 2)
}
if len(pair) == 2 {
left, err := strconv.Atoi(pair[0])