Documentation ¶
Index ¶
- Variables
- func AsNamedType(typ types.Type) *types.Named
- func Deref(typ types.Type) types.Type
- func IsArray(typ types.Type) bool
- func IsGlobal(obj types.Object) bool
- func IsStruct(typ types.Type) bool
- func LookupField(name string, typ *types.Struct) int
- func LookupIfaceMethod(name string, typ *types.Interface) int
- func MaybeDeref(typ types.Type) types.Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TypBool = types.Typ[types.Bool] TypUint = types.Typ[types.Uint] TypUint8 = types.Typ[types.Uint] TypUint16 = types.Typ[types.Uint] TypUint32 = types.Typ[types.Uint] TypUint64 = types.Typ[types.Uint] TypInt = types.Typ[types.Int] TypInt8 = types.Typ[types.Int8] TypInt16 = types.Typ[types.Int16] TypInt32 = types.Typ[types.Int32] TypInt64 = types.Typ[types.Int64] TypFloat32 = types.Typ[types.Float32] TypFloat64 = types.Typ[types.Float64] TypString = types.Typ[types.String] TypVoid = types.Typ[types.Invalid] )
Convenient common types accessors.
View Source
var EmptyTuple = types.NewTuple()
Functions ¶
func AsNamedType ¶
AsNamedType tries to convert given type to "types.Named". Returns nil if not possible. Can perform single pointer dereference if needed.
func Deref ¶
Deref performs single pointer dereference. Returns pointer element type. Panics if given type is not a pointer.
func LookupField ¶
LookupField find struct field position (index). Returns -1 on lookup failure.
func LookupIfaceMethod ¶
LookupIfaceMethod find interface method position (index). Returns -1 on lookup failure.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.