This commit is contained in:
neocarton 2019-12-22 18:01:39 +01:00 committed by GitHub
commit a11cb8c82d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,8 +79,13 @@ func ToBoolE(i interface{}) (bool, error) {
return b, nil
case nil:
return false, nil
case int:
if i.(int) != 0 {
case int, int32, int64, uint, uint32, uint64:
if b != 0 {
return true, nil
}
return false, nil
case float32, float64:
if b != 0.0 {
return true, nil
}
return false, nil