package reflect2

Import Path
	github.com/modern-go/reflect2 (on go.dev)

Dependency Relation
	imports 6 packages, and imported by one package


Package-Level Type Names (total 35, in which 21 are exported)
/* sort exporteds by: | */
( T) Type2(type1 reflect.Type) Type ( T) TypeOf(obj interface{}) Type
( T) AssignableTo(anotherType Type) bool ( T) Elem() Type ( T) GetIndex(obj interface{}, index int) interface{} ( T) Implements(thatType Type) bool Indirect dereference object represented pointer to this type ( T) IsNil(obj interface{}) bool ( T) IsNullable() bool ( T) Kind() reflect.Kind ( T) Len() int interface{} of this type has pointer like behavior New return pointer to data of this type PackEFace cast a unsafe pointer to object represented pointer ( T) RType() uintptr ( T) Set(obj interface{}, val interface{}) ( T) SetIndex(obj interface{}, index int, elem interface{}) ( T) String() string Type1 returns reflect.Type ( T) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer UnsafeIndirect dereference pointer to this type ( T) UnsafeIsNil(ptr unsafe.Pointer) bool UnsafeNew return the allocated space pointed by unsafe.Pointer ( T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) ( T) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer) *UnsafeArrayType *UnsafeSliceType T : ListType T : PtrType T : Type T : fmt.Stringer
UseSafeImplementation bool ( T) Froze() *frozenConfig
( T) NumMethod() int UnsafeArrayType UnsafeEFaceType UnsafeIFaceType UnsafeMapType UnsafePtrType UnsafeSliceType UnsafeStructType reflect.Type (interface) reflect.Value
( T) AssignableTo(anotherType Type) bool ( T) Elem() Type ( T) GetIndex(obj interface{}, index int) interface{} ( T) Implements(thatType Type) bool Indirect dereference object represented pointer to this type ( T) IsNil(obj interface{}) bool ( T) IsNullable() bool ( T) Kind() reflect.Kind interface{} of this type has pointer like behavior New return pointer to data of this type PackEFace cast a unsafe pointer to object represented pointer ( T) RType() uintptr ( T) Set(obj interface{}, val interface{}) ( T) SetIndex(obj interface{}, index int, elem interface{}) ( T) String() string Type1 returns reflect.Type ( T) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer UnsafeIndirect dereference pointer to this type ( T) UnsafeIsNil(ptr unsafe.Pointer) bool UnsafeNew return the allocated space pointed by unsafe.Pointer ( T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) ( T) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer) ArrayType (interface) SliceType (interface) *UnsafeArrayType *UnsafeSliceType T : PtrType T : Type T : fmt.Stringer
( T) HasNext() bool ( T) Next() (key interface{}, elem interface{}) ( T) UnsafeNext() (key unsafe.Pointer, elem unsafe.Pointer) *UnsafeMapIterator func MapType.Iterate(obj interface{}) MapIterator func MapType.UnsafeIterate(obj unsafe.Pointer) MapIterator func (*UnsafeMapType).Iterate(obj interface{}) MapIterator func (*UnsafeMapType).UnsafeIterate(obj unsafe.Pointer) MapIterator
( T) AssignableTo(anotherType Type) bool ( T) Elem() Type ( T) GetIndex(obj interface{}, key interface{}) interface{} ( T) Implements(thatType Type) bool Indirect dereference object represented pointer to this type ( T) IsNil(obj interface{}) bool ( T) IsNullable() bool ( T) Iterate(obj interface{}) MapIterator ( T) Key() Type ( T) Kind() reflect.Kind interface{} of this type has pointer like behavior ( T) MakeMap(cap int) interface{} New return pointer to data of this type PackEFace cast a unsafe pointer to object represented pointer ( T) RType() uintptr ( T) Set(obj interface{}, val interface{}) ( T) SetIndex(obj interface{}, key interface{}, elem interface{}) ( T) String() string ( T) TryGetIndex(obj interface{}, key interface{}) (interface{}, bool) Type1 returns reflect.Type ( T) UnsafeGetIndex(obj unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer UnsafeIndirect dereference pointer to this type ( T) UnsafeIsNil(ptr unsafe.Pointer) bool ( T) UnsafeIterate(obj unsafe.Pointer) MapIterator ( T) UnsafeMakeMap(cap int) unsafe.Pointer UnsafeNew return the allocated space pointed by unsafe.Pointer ( T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) ( T) UnsafeSetIndex(obj unsafe.Pointer, key unsafe.Pointer, elem unsafe.Pointer) *UnsafeMapType T : PtrType T : Type T : fmt.Stringer
( T) AssignableTo(anotherType Type) bool ( T) Elem() Type ( T) Implements(thatType Type) bool Indirect dereference object represented pointer to this type ( T) IsNil(obj interface{}) bool ( T) IsNullable() bool ( T) Kind() reflect.Kind interface{} of this type has pointer like behavior New return pointer to data of this type PackEFace cast a unsafe pointer to object represented pointer ( T) RType() uintptr ( T) Set(obj interface{}, val interface{}) ( T) String() string Type1 returns reflect.Type UnsafeIndirect dereference pointer to this type ( T) UnsafeIsNil(ptr unsafe.Pointer) bool UnsafeNew return the allocated space pointed by unsafe.Pointer ( T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) ArrayType (interface) ListType (interface) MapType (interface) SliceType (interface) *UnsafeArrayType *UnsafeEFaceType *UnsafeIFaceType *UnsafeMapType *UnsafePtrType *UnsafeSliceType *UnsafeStructType T : Type T : fmt.Stringer func TypeOfPtr(obj interface{}) PtrType
( T) Append(obj interface{}, elem interface{}) ( T) AssignableTo(anotherType Type) bool ( T) Cap(obj interface{}) int ( T) Elem() Type ( T) GetIndex(obj interface{}, index int) interface{} ( T) Grow(obj interface{}, newLength int) ( T) Implements(thatType Type) bool Indirect dereference object represented pointer to this type ( T) IsNil(obj interface{}) bool ( T) IsNullable() bool ( T) Kind() reflect.Kind ( T) LengthOf(obj interface{}) int interface{} of this type has pointer like behavior ( T) MakeSlice(length int, cap int) interface{} New return pointer to data of this type PackEFace cast a unsafe pointer to object represented pointer ( T) RType() uintptr ( T) Set(obj interface{}, val interface{}) ( T) SetIndex(obj interface{}, index int, elem interface{}) ( T) SetNil(obj interface{}) ( T) String() string Type1 returns reflect.Type ( T) UnsafeAppend(obj unsafe.Pointer, elem unsafe.Pointer) ( T) UnsafeCap(ptr unsafe.Pointer) int ( T) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer ( T) UnsafeGrow(ptr unsafe.Pointer, newLength int) UnsafeIndirect dereference pointer to this type ( T) UnsafeIsNil(ptr unsafe.Pointer) bool ( T) UnsafeLengthOf(ptr unsafe.Pointer) int ( T) UnsafeMakeSlice(length int, cap int) unsafe.Pointer UnsafeNew return the allocated space pointed by unsafe.Pointer ( T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) ( T) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer) ( T) UnsafeSetNil(ptr unsafe.Pointer) *UnsafeSliceType T : ListType T : PtrType T : Type T : fmt.Stringer
( T) Anonymous() bool ( T) Get(obj interface{}) interface{} ( T) Index() []int ( T) Name() string ( T) Offset() uintptr ( T) PkgPath() string ( T) Set(obj interface{}, value interface{}) ( T) Tag() reflect.StructTag ( T) Type() Type ( T) UnsafeGet(obj unsafe.Pointer) unsafe.Pointer ( T) UnsafeSet(obj unsafe.Pointer, value unsafe.Pointer) *UnsafeStructField func StructType.Field(i int) StructField func StructType.FieldByIndex(index []int) StructField func StructType.FieldByName(name string) StructField func StructType.FieldByNameFunc(match func(string) bool) StructField func (*UnsafeStructType).Field(i int) StructField func (*UnsafeStructType).FieldByIndex(index []int) StructField func (*UnsafeStructType).FieldByName(name string) StructField func (*UnsafeStructType).FieldByNameFunc(match func(string) bool) StructField
( T) AssignableTo(anotherType Type) bool ( T) Field(i int) StructField ( T) FieldByIndex(index []int) StructField ( T) FieldByName(name string) StructField ( T) FieldByNameFunc(match func(string) bool) StructField ( T) Implements(thatType Type) bool Indirect dereference object represented pointer to this type ( T) IsNil(obj interface{}) bool ( T) IsNullable() bool ( T) Kind() reflect.Kind interface{} of this type has pointer like behavior New return pointer to data of this type ( T) NumField() int PackEFace cast a unsafe pointer to object represented pointer ( T) RType() uintptr ( T) Set(obj interface{}, val interface{}) ( T) String() string Type1 returns reflect.Type UnsafeIndirect dereference pointer to this type ( T) UnsafeIsNil(ptr unsafe.Pointer) bool UnsafeNew return the allocated space pointed by unsafe.Pointer ( T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) *UnsafeStructType T : Type T : fmt.Stringer
( T) AssignableTo(anotherType Type) bool ( T) Implements(thatType Type) bool Indirect dereference object represented pointer to this type ( T) IsNil(obj interface{}) bool ( T) IsNullable() bool ( T) Kind() reflect.Kind interface{} of this type has pointer like behavior New return pointer to data of this type PackEFace cast a unsafe pointer to object represented pointer ( T) RType() uintptr ( T) Set(obj interface{}, val interface{}) ( T) String() string Type1 returns reflect.Type UnsafeIndirect dereference pointer to this type ( T) UnsafeIsNil(ptr unsafe.Pointer) bool UnsafeNew return the allocated space pointed by unsafe.Pointer ( T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) ArrayType (interface) ListType (interface) MapType (interface) PtrType (interface) SliceType (interface) StructType (interface) *UnsafeArrayType *UnsafeEFaceType *UnsafeIFaceType *UnsafeMapType *UnsafePtrType *UnsafeSliceType *UnsafeStructType T : fmt.Stringer func DefaultTypeOfKind(kind reflect.Kind) Type func PtrTo(typ Type) Type func Type2(type1 reflect.Type) Type func TypeByName(typeName string) Type func TypeByPackageName(pkgPath string, name string) Type func TypeOf(obj interface{}) Type func API.Type2(type1 reflect.Type) Type func API.TypeOf(obj interface{}) Type func ArrayType.Elem() Type func ListType.Elem() Type func MapType.Elem() Type func MapType.Key() Type func PtrType.Elem() Type func SliceType.Elem() Type func StructField.Type() Type func (*UnsafeMapType).Key() Type func (*UnsafeStructField).Type() Type func PtrTo(typ Type) Type func ArrayType.AssignableTo(anotherType Type) bool func ArrayType.Implements(thatType Type) bool func ListType.AssignableTo(anotherType Type) bool func ListType.Implements(thatType Type) bool func MapType.AssignableTo(anotherType Type) bool func MapType.Implements(thatType Type) bool func PtrType.AssignableTo(anotherType Type) bool func PtrType.Implements(thatType Type) bool func SliceType.AssignableTo(anotherType Type) bool func SliceType.Implements(thatType Type) bool func StructType.AssignableTo(anotherType Type) bool func StructType.Implements(thatType Type) bool func Type.AssignableTo(anotherType Type) bool func Type.Implements(thatType Type) bool func github.com/json-iterator/go.API.DecoderOf(typ Type) jsoniter.ValDecoder func github.com/json-iterator/go.API.EncoderOf(typ Type) jsoniter.ValEncoder func github.com/json-iterator/go.DecoderExtension.CreateDecoder(typ Type) jsoniter.ValDecoder func github.com/json-iterator/go.DecoderExtension.CreateEncoder(typ Type) jsoniter.ValEncoder func github.com/json-iterator/go.DecoderExtension.CreateMapKeyDecoder(typ Type) jsoniter.ValDecoder func github.com/json-iterator/go.DecoderExtension.CreateMapKeyEncoder(typ Type) jsoniter.ValEncoder func github.com/json-iterator/go.DecoderExtension.DecorateDecoder(typ Type, decoder jsoniter.ValDecoder) jsoniter.ValDecoder func github.com/json-iterator/go.DecoderExtension.DecorateEncoder(typ Type, encoder jsoniter.ValEncoder) jsoniter.ValEncoder func github.com/json-iterator/go.(*DummyExtension).CreateDecoder(typ Type) jsoniter.ValDecoder func github.com/json-iterator/go.(*DummyExtension).CreateEncoder(typ Type) jsoniter.ValEncoder func github.com/json-iterator/go.(*DummyExtension).CreateMapKeyDecoder(typ Type) jsoniter.ValDecoder func github.com/json-iterator/go.(*DummyExtension).CreateMapKeyEncoder(typ Type) jsoniter.ValEncoder func github.com/json-iterator/go.(*DummyExtension).DecorateDecoder(typ Type, decoder jsoniter.ValDecoder) jsoniter.ValDecoder func github.com/json-iterator/go.(*DummyExtension).DecorateEncoder(typ Type, encoder jsoniter.ValEncoder) jsoniter.ValEncoder func github.com/json-iterator/go.EncoderExtension.CreateDecoder(typ Type) jsoniter.ValDecoder func github.com/json-iterator/go.EncoderExtension.CreateEncoder(typ Type) jsoniter.ValEncoder func github.com/json-iterator/go.EncoderExtension.CreateMapKeyDecoder(typ Type) jsoniter.ValDecoder func github.com/json-iterator/go.EncoderExtension.CreateMapKeyEncoder(typ Type) jsoniter.ValEncoder func github.com/json-iterator/go.EncoderExtension.DecorateDecoder(typ Type, decoder jsoniter.ValDecoder) jsoniter.ValDecoder func github.com/json-iterator/go.EncoderExtension.DecorateEncoder(typ Type, encoder jsoniter.ValEncoder) jsoniter.ValEncoder func github.com/json-iterator/go.Extension.CreateDecoder(typ Type) jsoniter.ValDecoder func github.com/json-iterator/go.Extension.CreateEncoder(typ Type) jsoniter.ValEncoder func github.com/json-iterator/go.Extension.CreateMapKeyDecoder(typ Type) jsoniter.ValDecoder func github.com/json-iterator/go.Extension.CreateMapKeyEncoder(typ Type) jsoniter.ValEncoder func github.com/json-iterator/go.Extension.DecorateDecoder(typ Type, decoder jsoniter.ValDecoder) jsoniter.ValDecoder func github.com/json-iterator/go.Extension.DecorateEncoder(typ Type, encoder jsoniter.ValEncoder) jsoniter.ValEncoder
unsafeType.safeType.Type reflect.Type Align returns the alignment in bytes of a value of this type when allocated in memory. (*T) AssignableTo(anotherType Type) bool Bits returns the size of the type in bits. It panics if the type's Kind is not one of the sized or unsized Int, Uint, Float, or Complex kinds. ChanDir returns a channel type's direction. It panics if the type's Kind is not Chan. Comparable reports whether values of this type are comparable. ConvertibleTo reports whether a value of the type is convertible to type u. (*T) Elem() Type Field returns a struct type's i'th field. It panics if the type's Kind is not Struct. It panics if i is not in the range [0, NumField()). FieldAlign returns the alignment in bytes of a value of this type when used as a field in a struct. FieldByIndex returns the nested field corresponding to the index sequence. It is equivalent to calling Field successively for each index i. It panics if the type's Kind is not Struct. FieldByName returns the struct field with the given name and a boolean indicating if the field was found. FieldByNameFunc returns the struct field with a name that satisfies the match function and a boolean indicating if the field was found. FieldByNameFunc considers the fields in the struct itself and then the fields in any embedded structs, in breadth first order, stopping at the shallowest nesting depth containing one or more fields satisfying the match function. If multiple fields at that depth satisfy the match function, they cancel each other and FieldByNameFunc returns no match. This behavior mirrors Go's handling of name lookup in structs containing embedded fields. (*T) GetIndex(obj interface{}, index int) interface{} (*T) Implements(thatType Type) bool In returns the type of a function type's i'th input parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumIn()). (*T) Indirect(obj interface{}) interface{} (*T) IsNil(obj interface{}) bool (*T) IsNullable() bool IsVariadic reports whether a function type's final input parameter is a "..." parameter. If so, t.In(t.NumIn() - 1) returns the parameter's implicit actual type []T. For concreteness, if t represents func(x int, y ... float64), then t.NumIn() == 2 t.In(0) is the reflect.Type for "int" t.In(1) is the reflect.Type for "[]float64" t.IsVariadic() == true IsVariadic panics if the type's Kind is not Func. Key returns a map type's key type. It panics if the type's Kind is not Map. Kind returns the specific kind of this type. Len returns an array type's length. It panics if the type's Kind is not Array. (*T) LikePtr() bool Method returns the i'th method in the type's method set. It panics if i is not in the range [0, NumMethod()). For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver, and only exported methods are accessible. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Methods are sorted in lexicographic order. MethodByName returns the method with that name in the type's method set and a boolean indicating if the method was found. For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Name returns the type's name within its package for a defined type. For other (non-defined) types it returns the empty string. (*T) New() interface{} NumField returns a struct type's field count. It panics if the type's Kind is not Struct. NumIn returns a function type's input parameter count. It panics if the type's Kind is not Func. NumMethod returns the number of methods accessible using Method. Note that NumMethod counts unexported methods only for interface types. NumOut returns a function type's output parameter count. It panics if the type's Kind is not Func. Out returns the type of a function type's i'th output parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumOut()). (*T) PackEFace(ptr unsafe.Pointer) interface{} PkgPath returns a defined type's package path, that is, the import path that uniquely identifies the package, such as "encoding/base64". If the type was predeclared (string, error) or not defined (*T, struct{}, []int, or A where A is an alias for a non-defined type), the package path will be the empty string. (*T) RType() uintptr (*T) Set(obj interface{}, val interface{}) (*T) SetIndex(obj interface{}, index int, elem interface{}) Size returns the number of bytes needed to store a value of the given type; it is analogous to unsafe.Sizeof. String returns a string representation of the type. The string representation may use shortened package names (e.g., base64 instead of "encoding/base64") and is not guaranteed to be unique among types. To test for type identity, compare the Types directly. (*T) Type1() reflect.Type (*T) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer (*T) UnsafeIndirect(ptr unsafe.Pointer) interface{} (*T) UnsafeIsNil(ptr unsafe.Pointer) bool (*T) UnsafeNew() unsafe.Pointer (*T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) (*T) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer) *T : ArrayType T : InterfaceType *T : ListType *T : PtrType *T : Type T : fmt.Stringer
unsafeType.safeType.Type reflect.Type Align returns the alignment in bytes of a value of this type when allocated in memory. (*T) AssignableTo(anotherType Type) bool Bits returns the size of the type in bits. It panics if the type's Kind is not one of the sized or unsized Int, Uint, Float, or Complex kinds. ChanDir returns a channel type's direction. It panics if the type's Kind is not Chan. Comparable reports whether values of this type are comparable. ConvertibleTo reports whether a value of the type is convertible to type u. (*T) Elem() Type Field returns a struct type's i'th field. It panics if the type's Kind is not Struct. It panics if i is not in the range [0, NumField()). FieldAlign returns the alignment in bytes of a value of this type when used as a field in a struct. FieldByIndex returns the nested field corresponding to the index sequence. It is equivalent to calling Field successively for each index i. It panics if the type's Kind is not Struct. FieldByName returns the struct field with the given name and a boolean indicating if the field was found. FieldByNameFunc returns the struct field with a name that satisfies the match function and a boolean indicating if the field was found. FieldByNameFunc considers the fields in the struct itself and then the fields in any embedded structs, in breadth first order, stopping at the shallowest nesting depth containing one or more fields satisfying the match function. If multiple fields at that depth satisfy the match function, they cancel each other and FieldByNameFunc returns no match. This behavior mirrors Go's handling of name lookup in structs containing embedded fields. (*T) Implements(thatType Type) bool In returns the type of a function type's i'th input parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumIn()). (*T) Indirect(obj interface{}) interface{} (*T) IsNil(obj interface{}) bool (*T) IsNullable() bool IsVariadic reports whether a function type's final input parameter is a "..." parameter. If so, t.In(t.NumIn() - 1) returns the parameter's implicit actual type []T. For concreteness, if t represents func(x int, y ... float64), then t.NumIn() == 2 t.In(0) is the reflect.Type for "int" t.In(1) is the reflect.Type for "[]float64" t.IsVariadic() == true IsVariadic panics if the type's Kind is not Func. Key returns a map type's key type. It panics if the type's Kind is not Map. Kind returns the specific kind of this type. Len returns an array type's length. It panics if the type's Kind is not Array. (*T) LikePtr() bool Method returns the i'th method in the type's method set. It panics if i is not in the range [0, NumMethod()). For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver, and only exported methods are accessible. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Methods are sorted in lexicographic order. MethodByName returns the method with that name in the type's method set and a boolean indicating if the method was found. For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Name returns the type's name within its package for a defined type. For other (non-defined) types it returns the empty string. (*T) New() interface{} NumField returns a struct type's field count. It panics if the type's Kind is not Struct. NumIn returns a function type's input parameter count. It panics if the type's Kind is not Func. NumMethod returns the number of methods accessible using Method. Note that NumMethod counts unexported methods only for interface types. NumOut returns a function type's output parameter count. It panics if the type's Kind is not Func. Out returns the type of a function type's i'th output parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumOut()). (*T) PackEFace(ptr unsafe.Pointer) interface{} PkgPath returns a defined type's package path, that is, the import path that uniquely identifies the package, such as "encoding/base64". If the type was predeclared (string, error) or not defined (*T, struct{}, []int, or A where A is an alias for a non-defined type), the package path will be the empty string. (*T) RType() uintptr (*T) Set(obj interface{}, val interface{}) Size returns the number of bytes needed to store a value of the given type; it is analogous to unsafe.Sizeof. String returns a string representation of the type. The string representation may use shortened package names (e.g., base64 instead of "encoding/base64") and is not guaranteed to be unique among types. To test for type identity, compare the Types directly. (*T) Type1() reflect.Type (*T) UnsafeIndirect(ptr unsafe.Pointer) interface{} (*T) UnsafeIsNil(ptr unsafe.Pointer) bool (*T) UnsafeNew() unsafe.Pointer (*T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) T : InterfaceType *T : PtrType *T : Type T : fmt.Stringer
unsafeType.safeType.Type reflect.Type Align returns the alignment in bytes of a value of this type when allocated in memory. (*T) AssignableTo(anotherType Type) bool Bits returns the size of the type in bits. It panics if the type's Kind is not one of the sized or unsized Int, Uint, Float, or Complex kinds. ChanDir returns a channel type's direction. It panics if the type's Kind is not Chan. Comparable reports whether values of this type are comparable. ConvertibleTo reports whether a value of the type is convertible to type u. (*T) Elem() Type Field returns a struct type's i'th field. It panics if the type's Kind is not Struct. It panics if i is not in the range [0, NumField()). FieldAlign returns the alignment in bytes of a value of this type when used as a field in a struct. FieldByIndex returns the nested field corresponding to the index sequence. It is equivalent to calling Field successively for each index i. It panics if the type's Kind is not Struct. FieldByName returns the struct field with the given name and a boolean indicating if the field was found. FieldByNameFunc returns the struct field with a name that satisfies the match function and a boolean indicating if the field was found. FieldByNameFunc considers the fields in the struct itself and then the fields in any embedded structs, in breadth first order, stopping at the shallowest nesting depth containing one or more fields satisfying the match function. If multiple fields at that depth satisfy the match function, they cancel each other and FieldByNameFunc returns no match. This behavior mirrors Go's handling of name lookup in structs containing embedded fields. (*T) Implements(thatType Type) bool In returns the type of a function type's i'th input parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumIn()). (*T) Indirect(obj interface{}) interface{} (*T) IsNil(obj interface{}) bool (*T) IsNullable() bool IsVariadic reports whether a function type's final input parameter is a "..." parameter. If so, t.In(t.NumIn() - 1) returns the parameter's implicit actual type []T. For concreteness, if t represents func(x int, y ... float64), then t.NumIn() == 2 t.In(0) is the reflect.Type for "int" t.In(1) is the reflect.Type for "[]float64" t.IsVariadic() == true IsVariadic panics if the type's Kind is not Func. Key returns a map type's key type. It panics if the type's Kind is not Map. Kind returns the specific kind of this type. Len returns an array type's length. It panics if the type's Kind is not Array. (*T) LikePtr() bool Method returns the i'th method in the type's method set. It panics if i is not in the range [0, NumMethod()). For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver, and only exported methods are accessible. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Methods are sorted in lexicographic order. MethodByName returns the method with that name in the type's method set and a boolean indicating if the method was found. For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Name returns the type's name within its package for a defined type. For other (non-defined) types it returns the empty string. (*T) New() interface{} NumField returns a struct type's field count. It panics if the type's Kind is not Struct. NumIn returns a function type's input parameter count. It panics if the type's Kind is not Func. NumMethod returns the number of methods accessible using Method. Note that NumMethod counts unexported methods only for interface types. NumOut returns a function type's output parameter count. It panics if the type's Kind is not Func. Out returns the type of a function type's i'th output parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumOut()). (*T) PackEFace(ptr unsafe.Pointer) interface{} PkgPath returns a defined type's package path, that is, the import path that uniquely identifies the package, such as "encoding/base64". If the type was predeclared (string, error) or not defined (*T, struct{}, []int, or A where A is an alias for a non-defined type), the package path will be the empty string. (*T) RType() uintptr (*T) Set(obj interface{}, val interface{}) Size returns the number of bytes needed to store a value of the given type; it is analogous to unsafe.Sizeof. String returns a string representation of the type. The string representation may use shortened package names (e.g., base64 instead of "encoding/base64") and is not guaranteed to be unique among types. To test for type identity, compare the Types directly. (*T) Type1() reflect.Type (*T) UnsafeIndirect(ptr unsafe.Pointer) interface{} (*T) UnsafeIsNil(ptr unsafe.Pointer) bool (*T) UnsafeNew() unsafe.Pointer (*T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) T : InterfaceType *T : PtrType *T : Type T : fmt.Stringer
(*T) HasNext() bool (*T) Next() (interface{}, interface{}) (*T) UnsafeNext() (unsafe.Pointer, unsafe.Pointer) *T : MapIterator
unsafeType.safeType.Type reflect.Type Align returns the alignment in bytes of a value of this type when allocated in memory. (*T) AssignableTo(anotherType Type) bool Bits returns the size of the type in bits. It panics if the type's Kind is not one of the sized or unsized Int, Uint, Float, or Complex kinds. ChanDir returns a channel type's direction. It panics if the type's Kind is not Chan. Comparable reports whether values of this type are comparable. ConvertibleTo reports whether a value of the type is convertible to type u. (*T) Elem() Type Field returns a struct type's i'th field. It panics if the type's Kind is not Struct. It panics if i is not in the range [0, NumField()). FieldAlign returns the alignment in bytes of a value of this type when used as a field in a struct. FieldByIndex returns the nested field corresponding to the index sequence. It is equivalent to calling Field successively for each index i. It panics if the type's Kind is not Struct. FieldByName returns the struct field with the given name and a boolean indicating if the field was found. FieldByNameFunc returns the struct field with a name that satisfies the match function and a boolean indicating if the field was found. FieldByNameFunc considers the fields in the struct itself and then the fields in any embedded structs, in breadth first order, stopping at the shallowest nesting depth containing one or more fields satisfying the match function. If multiple fields at that depth satisfy the match function, they cancel each other and FieldByNameFunc returns no match. This behavior mirrors Go's handling of name lookup in structs containing embedded fields. (*T) GetIndex(obj interface{}, key interface{}) interface{} (*T) Implements(thatType Type) bool In returns the type of a function type's i'th input parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumIn()). (*T) Indirect(obj interface{}) interface{} (*T) IsNil(obj interface{}) bool (*T) IsNullable() bool IsVariadic reports whether a function type's final input parameter is a "..." parameter. If so, t.In(t.NumIn() - 1) returns the parameter's implicit actual type []T. For concreteness, if t represents func(x int, y ... float64), then t.NumIn() == 2 t.In(0) is the reflect.Type for "int" t.In(1) is the reflect.Type for "[]float64" t.IsVariadic() == true IsVariadic panics if the type's Kind is not Func. (*T) Iterate(obj interface{}) MapIterator (*T) Key() Type Kind returns the specific kind of this type. Len returns an array type's length. It panics if the type's Kind is not Array. (*T) LikePtr() bool (*T) MakeMap(cap int) interface{} Method returns the i'th method in the type's method set. It panics if i is not in the range [0, NumMethod()). For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver, and only exported methods are accessible. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Methods are sorted in lexicographic order. MethodByName returns the method with that name in the type's method set and a boolean indicating if the method was found. For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Name returns the type's name within its package for a defined type. For other (non-defined) types it returns the empty string. (*T) New() interface{} NumField returns a struct type's field count. It panics if the type's Kind is not Struct. NumIn returns a function type's input parameter count. It panics if the type's Kind is not Func. NumMethod returns the number of methods accessible using Method. Note that NumMethod counts unexported methods only for interface types. NumOut returns a function type's output parameter count. It panics if the type's Kind is not Func. Out returns the type of a function type's i'th output parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumOut()). (*T) PackEFace(ptr unsafe.Pointer) interface{} PkgPath returns a defined type's package path, that is, the import path that uniquely identifies the package, such as "encoding/base64". If the type was predeclared (string, error) or not defined (*T, struct{}, []int, or A where A is an alias for a non-defined type), the package path will be the empty string. (*T) RType() uintptr (*T) Set(obj interface{}, val interface{}) (*T) SetIndex(obj interface{}, key interface{}, elem interface{}) Size returns the number of bytes needed to store a value of the given type; it is analogous to unsafe.Sizeof. String returns a string representation of the type. The string representation may use shortened package names (e.g., base64 instead of "encoding/base64") and is not guaranteed to be unique among types. To test for type identity, compare the Types directly. (*T) TryGetIndex(obj interface{}, key interface{}) (interface{}, bool) (*T) Type1() reflect.Type (*T) UnsafeGetIndex(obj unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer (*T) UnsafeIndirect(ptr unsafe.Pointer) interface{} (*T) UnsafeIsNil(ptr unsafe.Pointer) bool (*T) UnsafeIterate(obj unsafe.Pointer) MapIterator (*T) UnsafeMakeMap(cap int) unsafe.Pointer (*T) UnsafeNew() unsafe.Pointer (*T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) (*T) UnsafeSetIndex(obj unsafe.Pointer, key unsafe.Pointer, elem unsafe.Pointer) T : InterfaceType *T : MapType *T : PtrType *T : Type T : fmt.Stringer
unsafeType.safeType.Type reflect.Type Align returns the alignment in bytes of a value of this type when allocated in memory. (*T) AssignableTo(anotherType Type) bool Bits returns the size of the type in bits. It panics if the type's Kind is not one of the sized or unsized Int, Uint, Float, or Complex kinds. ChanDir returns a channel type's direction. It panics if the type's Kind is not Chan. Comparable reports whether values of this type are comparable. ConvertibleTo reports whether a value of the type is convertible to type u. (*T) Elem() Type Field returns a struct type's i'th field. It panics if the type's Kind is not Struct. It panics if i is not in the range [0, NumField()). FieldAlign returns the alignment in bytes of a value of this type when used as a field in a struct. FieldByIndex returns the nested field corresponding to the index sequence. It is equivalent to calling Field successively for each index i. It panics if the type's Kind is not Struct. FieldByName returns the struct field with the given name and a boolean indicating if the field was found. FieldByNameFunc returns the struct field with a name that satisfies the match function and a boolean indicating if the field was found. FieldByNameFunc considers the fields in the struct itself and then the fields in any embedded structs, in breadth first order, stopping at the shallowest nesting depth containing one or more fields satisfying the match function. If multiple fields at that depth satisfy the match function, they cancel each other and FieldByNameFunc returns no match. This behavior mirrors Go's handling of name lookup in structs containing embedded fields. (*T) Implements(thatType Type) bool In returns the type of a function type's i'th input parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumIn()). (*T) Indirect(obj interface{}) interface{} (*T) IsNil(obj interface{}) bool (*T) IsNullable() bool IsVariadic reports whether a function type's final input parameter is a "..." parameter. If so, t.In(t.NumIn() - 1) returns the parameter's implicit actual type []T. For concreteness, if t represents func(x int, y ... float64), then t.NumIn() == 2 t.In(0) is the reflect.Type for "int" t.In(1) is the reflect.Type for "[]float64" t.IsVariadic() == true IsVariadic panics if the type's Kind is not Func. Key returns a map type's key type. It panics if the type's Kind is not Map. Kind returns the specific kind of this type. Len returns an array type's length. It panics if the type's Kind is not Array. (*T) LikePtr() bool Method returns the i'th method in the type's method set. It panics if i is not in the range [0, NumMethod()). For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver, and only exported methods are accessible. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Methods are sorted in lexicographic order. MethodByName returns the method with that name in the type's method set and a boolean indicating if the method was found. For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Name returns the type's name within its package for a defined type. For other (non-defined) types it returns the empty string. (*T) New() interface{} NumField returns a struct type's field count. It panics if the type's Kind is not Struct. NumIn returns a function type's input parameter count. It panics if the type's Kind is not Func. NumMethod returns the number of methods accessible using Method. Note that NumMethod counts unexported methods only for interface types. NumOut returns a function type's output parameter count. It panics if the type's Kind is not Func. Out returns the type of a function type's i'th output parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumOut()). (*T) PackEFace(ptr unsafe.Pointer) interface{} PkgPath returns a defined type's package path, that is, the import path that uniquely identifies the package, such as "encoding/base64". If the type was predeclared (string, error) or not defined (*T, struct{}, []int, or A where A is an alias for a non-defined type), the package path will be the empty string. (*T) RType() uintptr (*T) Set(obj interface{}, val interface{}) Size returns the number of bytes needed to store a value of the given type; it is analogous to unsafe.Sizeof. String returns a string representation of the type. The string representation may use shortened package names (e.g., base64 instead of "encoding/base64") and is not guaranteed to be unique among types. To test for type identity, compare the Types directly. (*T) Type1() reflect.Type (*T) UnsafeIndirect(ptr unsafe.Pointer) interface{} (*T) UnsafeIsNil(ptr unsafe.Pointer) bool (*T) UnsafeNew() unsafe.Pointer (*T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) T : InterfaceType *T : PtrType *T : Type T : fmt.Stringer
unsafeType.safeType.Type reflect.Type Align returns the alignment in bytes of a value of this type when allocated in memory. (*T) Append(obj interface{}, elem interface{}) (*T) AssignableTo(anotherType Type) bool Bits returns the size of the type in bits. It panics if the type's Kind is not one of the sized or unsized Int, Uint, Float, or Complex kinds. (*T) Cap(obj interface{}) int ChanDir returns a channel type's direction. It panics if the type's Kind is not Chan. Comparable reports whether values of this type are comparable. ConvertibleTo reports whether a value of the type is convertible to type u. (*T) Elem() Type Field returns a struct type's i'th field. It panics if the type's Kind is not Struct. It panics if i is not in the range [0, NumField()). FieldAlign returns the alignment in bytes of a value of this type when used as a field in a struct. FieldByIndex returns the nested field corresponding to the index sequence. It is equivalent to calling Field successively for each index i. It panics if the type's Kind is not Struct. FieldByName returns the struct field with the given name and a boolean indicating if the field was found. FieldByNameFunc returns the struct field with a name that satisfies the match function and a boolean indicating if the field was found. FieldByNameFunc considers the fields in the struct itself and then the fields in any embedded structs, in breadth first order, stopping at the shallowest nesting depth containing one or more fields satisfying the match function. If multiple fields at that depth satisfy the match function, they cancel each other and FieldByNameFunc returns no match. This behavior mirrors Go's handling of name lookup in structs containing embedded fields. (*T) GetIndex(obj interface{}, index int) interface{} (*T) Grow(obj interface{}, newLength int) (*T) Implements(thatType Type) bool In returns the type of a function type's i'th input parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumIn()). (*T) Indirect(obj interface{}) interface{} (*T) IsNil(obj interface{}) bool (*T) IsNullable() bool IsVariadic reports whether a function type's final input parameter is a "..." parameter. If so, t.In(t.NumIn() - 1) returns the parameter's implicit actual type []T. For concreteness, if t represents func(x int, y ... float64), then t.NumIn() == 2 t.In(0) is the reflect.Type for "int" t.In(1) is the reflect.Type for "[]float64" t.IsVariadic() == true IsVariadic panics if the type's Kind is not Func. Key returns a map type's key type. It panics if the type's Kind is not Map. Kind returns the specific kind of this type. Len returns an array type's length. It panics if the type's Kind is not Array. (*T) LengthOf(obj interface{}) int (*T) LikePtr() bool (*T) MakeSlice(length int, cap int) interface{} Method returns the i'th method in the type's method set. It panics if i is not in the range [0, NumMethod()). For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver, and only exported methods are accessible. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Methods are sorted in lexicographic order. MethodByName returns the method with that name in the type's method set and a boolean indicating if the method was found. For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Name returns the type's name within its package for a defined type. For other (non-defined) types it returns the empty string. (*T) New() interface{} NumField returns a struct type's field count. It panics if the type's Kind is not Struct. NumIn returns a function type's input parameter count. It panics if the type's Kind is not Func. NumMethod returns the number of methods accessible using Method. Note that NumMethod counts unexported methods only for interface types. NumOut returns a function type's output parameter count. It panics if the type's Kind is not Func. Out returns the type of a function type's i'th output parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumOut()). (*T) PackEFace(ptr unsafe.Pointer) interface{} PkgPath returns a defined type's package path, that is, the import path that uniquely identifies the package, such as "encoding/base64". If the type was predeclared (string, error) or not defined (*T, struct{}, []int, or A where A is an alias for a non-defined type), the package path will be the empty string. (*T) RType() uintptr (*T) Set(obj interface{}, val interface{}) (*T) SetIndex(obj interface{}, index int, elem interface{}) (*T) SetNil(obj interface{}) Size returns the number of bytes needed to store a value of the given type; it is analogous to unsafe.Sizeof. String returns a string representation of the type. The string representation may use shortened package names (e.g., base64 instead of "encoding/base64") and is not guaranteed to be unique among types. To test for type identity, compare the Types directly. (*T) Type1() reflect.Type (*T) UnsafeAppend(obj unsafe.Pointer, elem unsafe.Pointer) (*T) UnsafeCap(ptr unsafe.Pointer) int (*T) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer (*T) UnsafeGrow(obj unsafe.Pointer, newLength int) (*T) UnsafeIndirect(obj unsafe.Pointer) interface{} (*T) UnsafeIsNil(ptr unsafe.Pointer) bool (*T) UnsafeLengthOf(obj unsafe.Pointer) int (*T) UnsafeMakeSlice(length int, cap int) unsafe.Pointer (*T) UnsafeNew() unsafe.Pointer (*T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) (*T) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer) (*T) UnsafeSetNil(ptr unsafe.Pointer) *T : ArrayType T : InterfaceType *T : ListType *T : PtrType *T : SliceType *T : Type T : fmt.Stringer
StructField reflect.StructField (*T) Anonymous() bool (*T) Get(obj interface{}) interface{} (*T) Index() []int (*T) Name() string (*T) Offset() uintptr (*T) PkgPath() string (*T) Set(obj interface{}, value interface{}) (*T) Tag() reflect.StructTag (*T) Type() Type (*T) UnsafeGet(obj unsafe.Pointer) unsafe.Pointer (*T) UnsafeSet(obj unsafe.Pointer, value unsafe.Pointer) *T : StructField
unsafeType.safeType.Type reflect.Type Align returns the alignment in bytes of a value of this type when allocated in memory. (*T) AssignableTo(anotherType Type) bool Bits returns the size of the type in bits. It panics if the type's Kind is not one of the sized or unsized Int, Uint, Float, or Complex kinds. ChanDir returns a channel type's direction. It panics if the type's Kind is not Chan. Comparable reports whether values of this type are comparable. ConvertibleTo reports whether a value of the type is convertible to type u. (*T) Elem() Type (*T) Field(i int) StructField FieldAlign returns the alignment in bytes of a value of this type when used as a field in a struct. (*T) FieldByIndex(index []int) StructField (*T) FieldByName(name string) StructField (*T) FieldByNameFunc(match func(string) bool) StructField (*T) Implements(thatType Type) bool In returns the type of a function type's i'th input parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumIn()). (*T) Indirect(obj interface{}) interface{} (*T) IsNil(obj interface{}) bool (*T) IsNullable() bool IsVariadic reports whether a function type's final input parameter is a "..." parameter. If so, t.In(t.NumIn() - 1) returns the parameter's implicit actual type []T. For concreteness, if t represents func(x int, y ... float64), then t.NumIn() == 2 t.In(0) is the reflect.Type for "int" t.In(1) is the reflect.Type for "[]float64" t.IsVariadic() == true IsVariadic panics if the type's Kind is not Func. Key returns a map type's key type. It panics if the type's Kind is not Map. Kind returns the specific kind of this type. Len returns an array type's length. It panics if the type's Kind is not Array. (*T) LikePtr() bool Method returns the i'th method in the type's method set. It panics if i is not in the range [0, NumMethod()). For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver, and only exported methods are accessible. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Methods are sorted in lexicographic order. MethodByName returns the method with that name in the type's method set and a boolean indicating if the method was found. For a non-interface type T or *T, the returned Method's Type and Func fields describe a function whose first argument is the receiver. For an interface type, the returned Method's Type field gives the method signature, without a receiver, and the Func field is nil. Name returns the type's name within its package for a defined type. For other (non-defined) types it returns the empty string. (*T) New() interface{} NumField returns a struct type's field count. It panics if the type's Kind is not Struct. NumIn returns a function type's input parameter count. It panics if the type's Kind is not Func. NumMethod returns the number of methods accessible using Method. Note that NumMethod counts unexported methods only for interface types. NumOut returns a function type's output parameter count. It panics if the type's Kind is not Func. Out returns the type of a function type's i'th output parameter. It panics if the type's Kind is not Func. It panics if i is not in the range [0, NumOut()). (*T) PackEFace(ptr unsafe.Pointer) interface{} PkgPath returns a defined type's package path, that is, the import path that uniquely identifies the package, such as "encoding/base64". If the type was predeclared (string, error) or not defined (*T, struct{}, []int, or A where A is an alias for a non-defined type), the package path will be the empty string. (*T) RType() uintptr (*T) Set(obj interface{}, val interface{}) Size returns the number of bytes needed to store a value of the given type; it is analogous to unsafe.Sizeof. String returns a string representation of the type. The string representation may use shortened package names (e.g., base64 instead of "encoding/base64") and is not guaranteed to be unique among types. To test for type identity, compare the Types directly. (*T) Type1() reflect.Type (*T) UnsafeIndirect(ptr unsafe.Pointer) interface{} (*T) UnsafeIsNil(ptr unsafe.Pointer) bool (*T) UnsafeNew() unsafe.Pointer (*T) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) T : InterfaceType *T : PtrType *T : StructType *T : Type T : fmt.Stringer
Package-Level Functions (total 48, in which 14 are exported)
DefaultTypeOfKind return the non aliased default type for the kind
func IFaceToEFace(ptr unsafe.Pointer) interface{}
func IsNil(obj interface{}) bool
NoEscape hides a pointer from escape analysis. noescape is the identity function but escape analysis doesn't think the output depends on the input. noescape is inlined and currently compiles down to zero instructions. USE CAREFULLY!
func PtrOf(obj interface{}) unsafe.Pointer
func PtrTo(typ Type) Type
func RTypeOf(obj interface{}) uintptr
func Type2(type1 reflect.Type) Type
TypeByName return the type by its name, just like Class.forName in java
TypeByPackageName return the type by its package and name
func TypeOf(obj interface{}) Type
func TypeOfPtr(obj interface{}) PtrType
Package-Level Variables (total 6, in which 2 are exported)