package core import "reflect" func IsNil(input interface{}) bool { val := reflect.ValueOf(input) kind := val.Kind() switch kind { case reflect.Ptr, reflect.Array, reflect.Slice, reflect.Map, reflect.Func, reflect.Interface, reflect.Chan: return val.IsNil() case reflect.Struct, reflect.UnsafePointer: return false case reflect.Invalid: return true default: return false } }