check tag key

master
Ulric Qin 4 years ago
parent 88e6e4bf56
commit b65c8f696b

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

Loading…
Cancel
Save