反射操作普通变量-获取变量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
)

本文章首发在 LearnKu.com 网站上。

上一篇 下一篇
讨论数量: 0
发起讨论 只看当前版本


暂无话题~