Documentation
¶
Index ¶
- Constants
- func Clone(val reflect.Value) (res reflect.Value)
- func GetChildElem(v reflect.Value) (res reflect.Value)
- func GetElemKind(val reflect.Value) (res reflect.Kind)
- func GetInitElem(v reflect.Value) (res reflect.Value)
- func GetKind(val reflect.Value) (res reflect.Kind)
- func InitNew(val reflect.Value) (res reflect.Value)
- func IsArrayZero(v reflect.Value) bool
- func IsInterfaceReflectZero(val interface{}) (result bool)
- func IsReflectZero(val reflect.Value) (result bool)
- func IsStructZero(v reflect.Value) bool
- func IsTimeZero(t time.Time) bool
- func IsValueZero(v reflect.Value) bool
- func IsZero(k interface{}) bool
- func SetReflectZero(val reflect.Value)
- type Zeroable
Constants ¶
const ( ZeroTime0 = "0000-00-00 00:00:00" ZeroTime1 = "0001-01-01 00:00:00" )
List of constants for the zero time.
Variables ¶
This section is empty.
Functions ¶
func Clone ¶ added in v1.0.4
Clone clones the current underlying value of val as a reflect.Value. Clone can't clone unexported struct field because it is inaccessible.
func GetChildElem ¶
GetChildElem gets the child elem if it is a pointer with an element of pointer.
func GetElemKind ¶ added in v1.0.6
GetElemKind gets the elem kind from ptr type.
func GetInitElem ¶
GetInitElem gets the element of a pointer value. It initialize the element of a pointer value if it is nil.
func IsInterfaceReflectZero ¶ added in v1.0.1
func IsInterfaceReflectZero(val interface{}) (result bool)
IsInterfaceReflectZero checks whether the interface is nil. It also checks if the reflect.Value of val is reflect.Zero of it's type.
func IsReflectZero ¶ added in v1.0.1
IsReflectZero check if the val of reflect.Value is a reflect.Zero of it's type. This operation is solely based on reflect.Zero, not to check if the actual underlying value is zero. To check if the value of reflect.Value is zero, use IsZero or IsValueZero.
func IsStructZero ¶
IsStructZero checks if the struct is zero.
func IsValueZero ¶
IsValueZero check the reflect.Value if it is zero based on it's kind.
func SetReflectZero ¶ added in v1.0.3
SetReflectZero sets the val to the reflect.Zero of its type.