Documentation ¶
Index ¶
- func ComposeStructAnyEface(val interface{}, rawType reflect.Type) interface{}
- func CreateAnyStructOnElemType(val interface{}) interface{}
- func CreateAnyStructOnType(val interface{}) interface{}
- func DeepEqualNotType(x, y interface{}) bool
- func FuncInputTypeList(value reflect.Value, start int, isRecv bool, directNew func(i int) bool) []interface{}
- func FuncOutputTypeList(value reflect.Value, directNew func(i int) bool) []interface{}
- func IdentArrayOrSliceType(value interface{}) interface{}
- func IdentifyTypeNoInfo(value interface{}) (unsafe.Pointer, int)
- func InterDataPointer(val interface{}) unsafe.Pointer
- func PtrDeriveValue(ptrI interface{}, val interface{}) interface{}
- func RealType(value reflect.Value) reflect.Value
- func SliceBackSpace(p interface{}, n uint) interface{}
- func SliceIndex(p interface{}, n int) interface{}
- func ToTypePtr(v interface{}) (interface{}, bool)
- func ToValueTypeEface(val reflect.Value) interface{}
- type Eface
- type Iface
- type SliceHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeStructAnyEface ¶
装配Any.Any的空接口表示
func CreateAnyStructOnElemType ¶
func CreateAnyStructOnElemType(val interface{}) interface{}
CreateAnyStructOnElemType 通过数组/切片的元素类型 创建Any字段类型为[]val.Type的struct 返回的是其结构体的指针类型
func CreateAnyStructOnType ¶
func CreateAnyStructOnType(val interface{}) interface{}
CreateAnyStructOnType 通过val的类型 创建Any字段类型为val.Type的struct,返回值类型为结构体的指针
func FuncInputTypeList ¶
func FuncInputTypeList(value reflect.Value, start int, isRecv bool, directNew func(i int) bool) []interface{}
FuncInputTypeList 返回函数的输入参数类型列表,空接口切片表示 directNew是一个过滤器回调函数, 返回true指示new的类型是其原始类型, 返回false则代表new一个非指针类型并返回其指针 directNew()其入参的index当(isRecv == true), 它的值相当于减去接收器的参数的长度
Example if directNew() == true { Input(*reflect.Value) Exec -> return new(*reflect.Value)} if directNew() == false { Input(*reflect.Value) Exec -> tmp := new(reflect.Value) -> return &tmp}
func FuncOutputTypeList ¶
FuncOutputTypeList 返回函数的返回值类型列表,空接口切片表示 directNew是一个过滤器回调函数, 返回true指示new的类型是其原始类型, 返回false则代表new一个非指针类型并返回其指针 directNew()其入参的index当(isRecv == true), 它的值相当于减去接收器的参数的长度
Example if directNew() == true { Input(*reflect.Value) Exec -> return new(*reflect.Value)} if directNew() == false { Input(*reflect.Value) Exec -> tmp := new(reflect.Value) -> return &tmp}
func IdentArrayOrSliceType ¶
func IdentArrayOrSliceType(value interface{}) interface{}
IdentArrayOrSliceType 识别数组/切片元素类型 type&data为nil则直接返回nil,有类型信息则新建再识别
func IdentifyTypeNoInfo ¶
IdentifyTypeNoInfo 无类型信息的识别,识别一些简单类型的长度并返回它们的指针 只支持32-64位长度的类型
func InterDataPointer ¶
InterDataPointer 获得val对应eface-data指针的值
func PtrDeriveValue ¶
func PtrDeriveValue(ptrI interface{}, val interface{}) interface{}
PtrDeriveValue 根据ptrI提供的type,val提供的data派生一个eface 不会修改ptrI中的数据,因为只使用了reflect.TypeOf()获取type的指针 并没有使用ptrI中对应的efce的data的指针
func SliceBackSpace ¶
func SliceBackSpace(p interface{}, n uint) interface{}
func ToTypePtr ¶
func ToTypePtr(v interface{}) (interface{}, bool)
ToTypePtr 将一个非指针的interface{}转换为他的指针底层表示 Bool表示是否非指针类型
func ToValueTypeEface ¶
ToValueTypeEface 如果reflect.Value为nil则返回可以和nil比较的interface{}