Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertNotNil ¶ added in v2.0.17
func AssertNotNil(obj interface{}) error
func IsNil
deprecated
func IsNil(obj interface{}) bool
IsNil
Deprecated: 反射有性能问题,应尽可能避免使用此方法.
e.g.
var src interface{} = nil var src1 []string = nil var src2 map[string]interface{} = nil type bean struct { } var src3 *bean = nil fmt.Println(interfaceKit.IsNil(src)) // true fmt.Println(interfaceKit.IsNil(src1)) // true fmt.Println(interfaceKit.IsNil(src2)) // true fmt.Println(interfaceKit.IsNil(src3)) // true
func IsZeroValue ¶
func IsZeroValue[T comparable](v T) bool
IsZeroValue 传参v是否是类型T的零值?
e.g. [interface{}](nil) => true
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.