check tag key

This commit is contained in:
Ulric Qin 2021-07-16 23:30:09 +08:00
parent 88e6e4bf56
commit b65c8f696b
1 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package istr
import (
"strings"
"strconv"
)
func SampleKeyInvalid(str string) bool {
@ -13,5 +14,11 @@ func SampleKeyInvalid(str string) bool {
r == ' ' ||
r == '='
})
return idx != -1
if idx != -1 {
return true
}
_, err := strconv.ParseFloat(str, 64)
return err == nil
}