[golang]golang reflect详细用法整理
附:package reflect包类型函数说明
func Copy(dst, src Value) int
func DeepEqual(a1, a2 interface{}) bool
func Select(cases []SelectCase) (chosen int, recv Value, recvOKbool)
type ChanDir
func (d ChanDir) String() string
type Kind
const(
Invalid Kind = iota
Bool
Int
Int8
Int16
Int32
Int64
Uint
Uint8
Uint16
Uint32
Uint64
Uintptr
Float32
Float64
Complex64
Complex128
Array
Chan
Func
Interface
Map
Ptr
Slice
String
Struct
UnsafePointer
)
func (kKind) String() string
type Method
type SelectCase
type SelectDir
type SliceHeader
type StringHeader
type StructField
type StructTag
func (tag StructTag) Get(key string) string
type Type
funcChanOf(dir ChanDir, t Type) Type
funcMapOf(key, elem Type) Type
func PtrTo(tType) Type
funcSliceOf(t Type) Type
funcTypeOf(i interface{}) Type
type Value
funcAppend(s Value, x ...Value) Value
funcAppendSlice(s, t Value) Value
funcIndirect(v Value) Value
funcMakeChan(typ Type, buffer int) Value
funcMakeFunc(typ Type, fn func(args []Value) (results []Value))Value
funcMakeMap(typ Type) Value
funcMakeSlice(typ Type, len, cap int) Value
func New(typType) Value
funcNewAt(typ Type, p unsafe.Pointer) Value
funcValueOf(i interface{}) Value
funcZero(typ Type) Value
func (vValue) Addr() Value
func (vValue) Bool() bool
func (vValue) Bytes() []byte
func (vValue) Call(in []Value) []Value
func (vValue) CallSlice(in []Value) []Value
func (vValue) CanAddr() bool
func (vValue) CanInterface() bool
func (vValue) CanSet() bool
func (vValue) Cap() int
func (vValue) Close()
func (vValue) Complex() complex128
func (vValue) Convert(t Type) Value
func (vValue) Elem() Value
func (vValue) Field(i int) Value
func (vValue) FieldByIndex(index []int) Value
func (vValue) FieldByName(name string) Value
func (vValue) FieldByNameFunc(match func(string) bool) Value
func (vValue) Float() float64
func (vValue) Index(i int) Value
func (vValue) Int() int64
func (vValue) Interface() (i interface{})
func (vValue) InterfaceData() [2]uintptr
func (vValue) IsNil() bool
func (vValue) IsValid() bool
func (vValue) Kind() Kind
func (vValue) Len() int
func (vValue) MapIndex(key Value) Value
func (vValue) MapKeys() []Value
func (vValue) Method(i int) Value
func (vValue) MethodByName(name string) Value
func (vValue) NumField() int
func (vValue) NumMethod() int
func (vValue) OverflowComplex(x complex128) bool
func (vValue) OverflowFloat(x float64) bool
func (vValue) OverflowInt(x int64) bool
func (vValue) OverflowUint(x uint64) bool
func (vValue) Pointer() uintptr
func (vValue) Recv() (x Value, ok bool)
func (vValue) Send(x Value)
func (vValue) Set(x Value)
func (vValue) SetBool(x bool)
func (vValue) SetBytes(x []byte)
func (vValue) SetComplex(x complex128)
func (vValue) SetFloat(x float64)
func (vValue) SetInt(x int64)
func (vValue) SetLen(n int)
func (vValue) SetMapIndex(key, val Value)
func (vValue) SetPointer(x unsafe.Pointer)
func (vValue) SetString(x string)
func (vValue) SetUint(x uint64)
func (vValue) Slice(beg, end int) Value
func (vValue) String() string
func (vValue) TryRecv() (x Value, ok bool)
func (vValue) TrySend(x Value) bool
func (vValue) Type() Type
func (vValue) Uint() uint64
func (vValue) UnsafeAddr() uintptr
type ValueError
func (e *ValueError) Error() string