Documentation
¶
Index ¶
- func FuncEqual(fn1, fn2 any) bool
- func GetFuncName(fn any) string
- func GetFuncSignature(fn any) string
- func GetStructName(obj any) string
- func GetVarName(v any) string
- func Indirect(a any) any
- func IsAssignableStruct(obj any) bool
- func MatchReceiverMethods(receiver any, matchFn any) map[string]any
- func StructSet(obj any, nilField any, val any) error
- type Utils
- type Value
- type ValueItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Indirect ¶ added in v0.0.22
Indirect returns the value, after dereferencing as many times as necessary to reach the base type (or nil).
func IsAssignableStruct ¶ added in v0.0.17
IsAssignableStruct 是否是可赋值的结构指针类型
func MatchReceiverMethods ¶
MatchReceiverMethods 匹配receiver的所有methods中与matchFn签名参数类似的方法
Types ¶
type Utils ¶
type Utils interface {
GetFuncName(fn any) string //从函数实例获取函数名
GetStructName(obj any) string // 从实例获取结构名
GetVarName(v any) string // 获取变量名
StructSet(obj any, nilField any, val any) error // 给结构体设置field类型的值
MatchReceiverMethods(receiver any, matchFn any) map[string]any // 匹配receiver的所有methods中与matchFn签名参数类似的方法
GetFuncSignature(fn any) string // 获取函数签名信息
InspectValue(v any) Value // 检索Value的信息
FuncEqual(fn1, fn2 any) bool // 函数是否相等
IsAssignableStruct(obj any) bool // 是否是可赋值的结构指针类型
Indirect(a any) any // 通过尽可能的解引用获取底层的类型
}
type Value ¶
func InspectValue ¶
Click to show internal directories.
Click to hide internal directories.