type/interfaceutil/interfaceutil.go
Function ToInt
has 8 return statements (exceeds 4 allowed). Open
Open
func ToInt(v any, defaultValue int) int {
if v == nil {
return defaultValue
} else if valBool, ok := v.(bool); ok {
if valBool {
Avoid deeply nested control flow statements. Open
Open
} else if valFloat, ok := v.(float64); ok {
return valFloat != 0.0
}
Avoid deeply nested control flow statements. Open
Open
} else if valFloat, ok := v.(float64); ok {
return int(valFloat)
} else {
return defaultValue
}
Function ToBool
has 6 return statements (exceeds 4 allowed). Open
Open
func ToBool(v any) bool {
if v == nil {
return false
} else if valBool, ok := v.(bool); ok {
return valBool