gitlab.com/evatix-go/core@v1.3.55/internal/reflectinternal/IsNull.go (about) 1 package reflectinternal 2 3 import "reflect" 4 5 func IsNull(item interface{}) bool { 6 if item == nil { 7 return true 8 } 9 10 rv := reflect.ValueOf(item) 11 12 switch rv.Kind() { 13 case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Slice: 14 return rv.IsNil() 15 default: 16 return false 17 } 18 }