Documentation
¶
Index ¶
- func GetAllFieldName(m interface{}) ([]string, error)
- func GetFieldByName(m interface{}, n string) (reflect.StructField, error)
- func GetFieldValueByName(m interface{}, n string) reflect.Value
- func GetType(m interface{}) reflect.Type
- func GetValueByName(m interface{}, n string) interface{}
- func IsPoint(m interface{}) bool
- func IsPtr[T any](v T) bool
- func NilOrZero(m interface{}, fs string) bool
- func PrintInterface(v interface{})
- func SafeStruct(v interface{}) interface{}
- func SafeValue[T any](v T) T
- func SetFieldValue(m interface{}, n string, v reflect.Value) error
- func ToInterfaceSlice(src interface{}) []interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllFieldName ¶
func GetFieldByName ¶
func GetFieldByName(m interface{}, n string) (reflect.StructField, error)
func GetFieldValueByName ¶
func GetValueByName ¶
func GetValueByName(m interface{}, n string) interface{}
func PrintInterface ¶
func PrintInterface(v interface{})
PrintInterface print the interface by level
func SafeStruct ¶
func SafeStruct(v interface{}) interface{}
SafeStruct 必须传入指针 它会将空指针的字段设置为该类型的零值的指针 传入空指针会返回一个所有字段都为零值的结构体
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.