mirror of
https://github.com/Fishwaldo/validator.git
synced 2025-07-07 13:40:16 +00:00
Merge remote-tracking branch 'upstream/v5' into v6-development
This commit is contained in:
commit
953cc993e6
1 changed files with 5 additions and 5 deletions
10
baked_in.go
10
baked_in.go
|
@ -592,7 +592,7 @@ func isGte(top interface{}, current interface{}, field interface{}, param string
|
||||||
case reflect.String:
|
case reflect.String:
|
||||||
p := asInt(param)
|
p := asInt(param)
|
||||||
|
|
||||||
return int64(len(st.String())) >= p
|
return int64(utf8.RuneCountInString(st.String())) >= p
|
||||||
|
|
||||||
case reflect.Slice, reflect.Map, reflect.Array:
|
case reflect.Slice, reflect.Map, reflect.Array:
|
||||||
p := asInt(param)
|
p := asInt(param)
|
||||||
|
@ -637,7 +637,7 @@ func isGt(top interface{}, current interface{}, field interface{}, param string)
|
||||||
case reflect.String:
|
case reflect.String:
|
||||||
p := asInt(param)
|
p := asInt(param)
|
||||||
|
|
||||||
return int64(len(st.String())) > p
|
return int64(utf8.RuneCountInString(st.String())) > p
|
||||||
|
|
||||||
case reflect.Slice, reflect.Map, reflect.Array:
|
case reflect.Slice, reflect.Map, reflect.Array:
|
||||||
p := asInt(param)
|
p := asInt(param)
|
||||||
|
@ -681,7 +681,7 @@ func hasLengthOf(top interface{}, current interface{}, field interface{}, param
|
||||||
case reflect.String:
|
case reflect.String:
|
||||||
p := asInt(param)
|
p := asInt(param)
|
||||||
|
|
||||||
return int64(len(st.String())) == p
|
return int64(utf8.RuneCountInString(st.String())) == p
|
||||||
|
|
||||||
case reflect.Slice, reflect.Map, reflect.Array:
|
case reflect.Slice, reflect.Map, reflect.Array:
|
||||||
p := asInt(param)
|
p := asInt(param)
|
||||||
|
@ -875,7 +875,7 @@ func isLte(top interface{}, current interface{}, field interface{}, param string
|
||||||
case reflect.String:
|
case reflect.String:
|
||||||
p := asInt(param)
|
p := asInt(param)
|
||||||
|
|
||||||
return int64(len(st.String())) <= p
|
return int64(utf8.RuneCountInString(st.String())) <= p
|
||||||
|
|
||||||
case reflect.Slice, reflect.Map, reflect.Array:
|
case reflect.Slice, reflect.Map, reflect.Array:
|
||||||
p := asInt(param)
|
p := asInt(param)
|
||||||
|
@ -920,7 +920,7 @@ func isLt(top interface{}, current interface{}, field interface{}, param string)
|
||||||
case reflect.String:
|
case reflect.String:
|
||||||
p := asInt(param)
|
p := asInt(param)
|
||||||
|
|
||||||
return int64(len(st.String())) < p
|
return int64(utf8.RuneCountInString(st.String())) < p
|
||||||
|
|
||||||
case reflect.Slice, reflect.Map, reflect.Array:
|
case reflect.Slice, reflect.Map, reflect.Array:
|
||||||
p := asInt(param)
|
p := asInt(param)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue