forked from mirror/gjson
Use lowercase string booleans
This commit is contained in:
parent
eeddc5431f
commit
71341b2042
4
gjson.go
4
gjson.go
|
@ -106,8 +106,8 @@ func (t Result) Bool() bool {
|
||||||
case True:
|
case True:
|
||||||
return true
|
return true
|
||||||
case String:
|
case String:
|
||||||
b, err := strconv.ParseBool(t.Str)
|
b, _ := strconv.ParseBool(strings.ToLower(t.Str))
|
||||||
return !(!b || err != nil)
|
return b
|
||||||
case Number:
|
case Number:
|
||||||
return t.Num != 0
|
return t.Num != 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue