反射操作普通变量-获取变量Kind
获取变量Kind
通过反射,可以拿到变量的kind(类别)。 Reflect.Value.Kind()
func (v Value) Kind() Kind
Kind代表Type类型值表示的具体分类。使用枚举常量表示。参见帮助手册。
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
)