INNER CODE UNIT · Go
emptyCollection
abahmed/kwatch · cmd/configcatalog/main.go:222
func emptyCollection(t reflect.Type, value reflect.Value) bool {
if t.Kind() == reflect.Pointer {
t = t.Elem()
}
switch t.Kind() {
case reflect.Slice, reflect.Map, reflect.Array:
return !value.IsValid() || value.Len() == 0
}
return false
}