Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForceGetValue ¶
ForceGetValue force get the value hold by reflect.Value. The type param T must be the type that the Value stored, or this function will paniced.
func ForceSetValue ¶
ForceSetValue force set reflect.Value, no matter where value if readonly, not addressable, or has different types(but has same size). The type param T must be the type that the Value stored, or this function will paniced. This function returns true if the original value is modified(when and only when Value is indrect and addressable); Returns false otherwise, only the ptr field in Value is update, there is no standalone origional value, or origional value is not modified.
func GetPointer ¶ added in v2.3.0
GetPointer return the pointer to reflect value.
func StructToMap ¶
StructToMap shallow convert struct to map, using field name as key, field value as map value. The Field name can be overridden using 'name' struct tag.
Note: only exported fields are set into map.
Types ¶
type CallerInfo ¶
type CallerInfo struct { Package string // Package Name File string // File Name Function string // Function Name LineNo int // Line number }
CallerInfo is caller info
func GetCaller ¶
func GetCaller(depth int) *CallerInfo
GetCaller return the caller info, param depth indicate the stack depth to the caller; for direct caller, depth is 1