improve package internal/empty
@@ -69,12 +69,21 @@ func IsEmpty(value interface{}) bool {
default:
// Common interfaces checks.
if f, ok := value.(apiString); ok {
+ if f == nil {
+ return true
+ }
return f.String() == ""
}
if f, ok := value.(apiInterfaces); ok {
+ if f == nil {
+ return true
+ }
return len(f.Interfaces()) == 0
}
if f, ok := value.(apiMapStrAny); ok {
+ if f == nil {
+ return true
+ }
return len(f.MapStrAny()) == 0
}
// Finally using reflect.
