Versions in this module Expand all Collapse all go1 go1.18.10 Jan 10, 2023 Changes in this version + var Typ = [...]*Basic + func AssertableTo(V *Interface, T Type) bool + func AssignableTo(V, T Type) bool + func Comparable(T Type) bool + func ConvertibleTo(V, T Type) bool + func DefPredeclaredTestFuncs() + func Id(pkg *Package, name string) string + func Identical(x, y Type) bool + func IdenticalIgnoreTags(x, y Type) bool + func Implements(V Type, T *Interface) bool + func IsInterface(t Type) bool + func ObjectString(obj Object, qf Qualifier) string + func SelectionString(s *Selection, qf Qualifier) string + func TypeString(typ Type, qf Qualifier) string + func WriteSignature(buf *bytes.Buffer, sig *Signature, qf Qualifier) + func WriteType(buf *bytes.Buffer, typ Type, qf Qualifier) + type ArgumentError struct + Err error + Index int + func (e *ArgumentError) Error() string + func (e *ArgumentError) Unwrap() error + type Array struct + func NewArray(elem Type, len int64) *Array + func (a *Array) Elem() Type + func (a *Array) Len() int64 + func (a *Array) String() string + func (a *Array) Underlying() Type + type Basic struct + func (b *Basic) Info() BasicInfo + func (b *Basic) Kind() BasicKind + func (b *Basic) Name() string + func (b *Basic) String() string + func (b *Basic) Underlying() Type + type BasicInfo int + const IsBoolean + const IsComplex + const IsConstType + const IsFloat + const IsInteger + const IsNumeric + const IsOrdered + const IsString + const IsUnsigned + const IsUntyped + type BasicKind int + const Bool + const Byte + const Complex128 + const Complex64 + const Float32 + const Float64 + const Int + const Int16 + const Int32 + const Int64 + const Int8 + const Invalid + const Rune + const String + const Uint + const Uint16 + const Uint32 + const Uint64 + const Uint8 + const Uintptr + const UnsafePointer + const UntypedBool + const UntypedComplex + const UntypedFloat + const UntypedInt + const UntypedNil + const UntypedRune + const UntypedString + type Builtin struct + func (obj *Builtin) Exported() bool + func (obj *Builtin) Id() string + func (obj *Builtin) Name() string + func (obj *Builtin) Parent() *Scope + func (obj *Builtin) Pkg() *Package + func (obj *Builtin) Pos() syntax.Pos + func (obj *Builtin) String() string + func (obj *Builtin) Type() Type + type Chan struct + func NewChan(dir ChanDir, elem Type) *Chan + func (c *Chan) Dir() ChanDir + func (c *Chan) Elem() Type + func (c *Chan) String() string + func (c *Chan) Underlying() Type + type ChanDir int + const RecvOnly + const SendOnly + const SendRecv + type Checker struct + func NewChecker(conf *Config, pkg *Package, info *Info) *Checker + func (check *Checker) Files(files []*syntax.File) error + type Config struct + CompilerErrorMessages bool + Context *Context + DisableUnusedImportCheck bool + Error func(err error) + FakeImportC bool + GoVersion string + IgnoreFuncBodies bool + IgnoreLabels bool + Importer Importer + Sizes Sizes + Trace bool + func (conf *Config) Check(path string, files []*syntax.File, info *Info) (*Package, error) + type Const struct + func NewConst(pos syntax.Pos, pkg *Package, name string, typ Type, val constant.Value) *Const + func (obj *Const) Exported() bool + func (obj *Const) Id() string + func (obj *Const) Name() string + func (obj *Const) Parent() *Scope + func (obj *Const) Pkg() *Package + func (obj *Const) Pos() syntax.Pos + func (obj *Const) String() string + func (obj *Const) Type() Type + func (obj *Const) Val() constant.Value + type Context struct + func NewContext() *Context + type Error struct + Full string + Msg string + Pos syntax.Pos + Soft bool + func (err Error) Error() string + func (err Error) FullError() string + type Func struct + func MissingMethod(V Type, T *Interface, static bool) (method *Func, wrongType bool) + func NewFunc(pos syntax.Pos, pkg *Package, name string, sig *Signature) *Func + func (obj *Func) Exported() bool + func (obj *Func) FullName() string + func (obj *Func) Id() string + func (obj *Func) Name() string + func (obj *Func) Parent() *Scope + func (obj *Func) Pkg() *Package + func (obj *Func) Pos() syntax.Pos + func (obj *Func) Scope() *Scope + func (obj *Func) String() string + func (obj *Func) Type() Type + type ImportMode int + type Importer interface + Import func(path string) (*Package, error) + type ImporterFrom interface + ImportFrom func(path, dir string, mode ImportMode) (*Package, error) + type Info struct + Defs map[*syntax.Name]Object + Implicits map[syntax.Node]Object + InitOrder []*Initializer + Instances map[*syntax.Name]Instance + Scopes map[syntax.Node]*Scope + Selections map[*syntax.SelectorExpr]*Selection + Types map[syntax.Expr]TypeAndValue + Uses map[*syntax.Name]Object + func (info *Info) ObjectOf(id *syntax.Name) Object + func (info *Info) TypeOf(e syntax.Expr) Type + type Initializer struct + Lhs []*Var + Rhs syntax.Expr + func (init *Initializer) String() string + type Instance struct + Type Type + TypeArgs *TypeList + type Interface struct + func NewInterfaceType(methods []*Func, embeddeds []Type) *Interface + func (t *Interface) EmbeddedType(i int) Type + func (t *Interface) Empty() bool + func (t *Interface) ExplicitMethod(i int) *Func + func (t *Interface) IsComparable() bool + func (t *Interface) IsImplicit() bool + func (t *Interface) IsMethodSet() bool + func (t *Interface) MarkImplicit() + func (t *Interface) Method(i int) *Func + func (t *Interface) NumEmbeddeds() int + func (t *Interface) NumExplicitMethods() int + func (t *Interface) NumMethods() int + func (t *Interface) String() string + func (t *Interface) Underlying() Type + type Label struct + func NewLabel(pos syntax.Pos, pkg *Package, name string) *Label + func (obj *Label) Exported() bool + func (obj *Label) Id() string + func (obj *Label) Name() string + func (obj *Label) Parent() *Scope + func (obj *Label) Pkg() *Package + func (obj *Label) Pos() syntax.Pos + func (obj *Label) String() string + func (obj *Label) Type() Type + type Map struct + func NewMap(key, elem Type) *Map + func (m *Map) Elem() Type + func (m *Map) Key() Type + func (t *Map) String() string + func (t *Map) Underlying() Type + type Named struct + func NewNamed(obj *TypeName, underlying Type, methods []*Func) *Named + func (t *Named) AddMethod(m *Func) + func (t *Named) Method(i int) *Func + func (t *Named) NumMethods() int + func (t *Named) Obj() *TypeName + func (t *Named) Origin() *Named + func (t *Named) SetTypeParams(tparams []*TypeParam) + func (t *Named) SetUnderlying(underlying Type) + func (t *Named) String() string + func (t *Named) TypeArgs() *TypeList + func (t *Named) TypeParams() *TypeParamList + func (t *Named) Underlying() Type + type Nil struct + func (obj *Nil) Exported() bool + func (obj *Nil) Id() string + func (obj *Nil) Name() string + func (obj *Nil) Parent() *Scope + func (obj *Nil) Pkg() *Package + func (obj *Nil) Pos() syntax.Pos + func (obj *Nil) String() string + func (obj *Nil) Type() Type + type Object interface + Exported func() bool + Id func() string + Name func() string + Parent func() *Scope + Pkg func() *Package + Pos func() syntax.Pos + String func() string + Type func() Type + func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (obj Object, index []int, indirect bool) + type Package struct + var Unsafe *Package + func NewPackage(path, name string) *Package + func NewPackageHeight(path, name string, height int) *Package + func (pkg *Package) Complete() bool + func (pkg *Package) Height() int + func (pkg *Package) Imports() []*Package + func (pkg *Package) MarkComplete() + func (pkg *Package) Name() string + func (pkg *Package) Path() string + func (pkg *Package) Scope() *Scope + func (pkg *Package) SetImports(list []*Package) + func (pkg *Package) SetName(name string) + func (pkg *Package) String() string + type PkgName struct + func NewPkgName(pos syntax.Pos, pkg *Package, name string, imported *Package) *PkgName + func (obj *PkgName) Exported() bool + func (obj *PkgName) Id() string + func (obj *PkgName) Imported() *Package + func (obj *PkgName) Name() string + func (obj *PkgName) Parent() *Scope + func (obj *PkgName) Pkg() *Package + func (obj *PkgName) Pos() syntax.Pos + func (obj *PkgName) String() string + func (obj *PkgName) Type() Type + type Pointer struct + func AsPointer(t Type) *Pointer + func NewPointer(elem Type) *Pointer + func (p *Pointer) Elem() Type + func (p *Pointer) String() string + func (p *Pointer) Underlying() Type + type Qualifier func(*Package) string + func RelativeTo(pkg *Package) Qualifier + type Scope struct + var Universe *Scope + func NewScope(parent *Scope, pos, end syntax.Pos, comment string) *Scope + func (s *Scope) Child(i int) *Scope + func (s *Scope) Contains(pos syntax.Pos) bool + func (s *Scope) End() syntax.Pos + func (s *Scope) Innermost(pos syntax.Pos) *Scope + func (s *Scope) Insert(obj Object) Object + func (s *Scope) InsertLazy(name string, resolve func() Object) bool + func (s *Scope) Len() int + func (s *Scope) Lookup(name string) Object + func (s *Scope) LookupParent(name string, pos syntax.Pos) (*Scope, Object) + func (s *Scope) Names() []string + func (s *Scope) NumChildren() int + func (s *Scope) Parent() *Scope + func (s *Scope) Pos() syntax.Pos + func (s *Scope) Squash(err func(obj, alt Object)) + func (s *Scope) String() string + func (s *Scope) WriteTo(w io.Writer, n int, recurse bool) + type Selection struct + func (s *Selection) Index() []int + func (s *Selection) Indirect() bool + func (s *Selection) Kind() SelectionKind + func (s *Selection) Obj() Object + func (s *Selection) Recv() Type + func (s *Selection) String() string + func (s *Selection) Type() Type + type SelectionKind int + const FieldVal + const MethodExpr + const MethodVal + type Signature struct + func AsSignature(t Type) *Signature + func NewSignatureType(recv *Var, recvTypeParams, typeParams []*TypeParam, params, results *Tuple, ...) *Signature + func (s *Signature) Params() *Tuple + func (s *Signature) Recv() *Var + func (s *Signature) RecvTypeParams() *TypeParamList + func (s *Signature) Results() *Tuple + func (s *Signature) SetTypeParams(tparams []*TypeParam) + func (s *Signature) String() string + func (s *Signature) TypeParams() *TypeParamList + func (s *Signature) Underlying() Type + func (s *Signature) Variadic() bool + type Sizes interface + Alignof func(T Type) int64 + Offsetsof func(fields []*Var) []int64 + Sizeof func(T Type) int64 + func SizesFor(compiler, arch string) Sizes + type Slice struct + func NewSlice(elem Type) *Slice + func (s *Slice) Elem() Type + func (s *Slice) String() string + func (s *Slice) Underlying() Type + type StdSizes struct + MaxAlign int64 + WordSize int64 + func (s *StdSizes) Alignof(T Type) int64 + func (s *StdSizes) Offsetsof(fields []*Var) []int64 + func (s *StdSizes) Sizeof(T Type) int64 + type Struct struct + func NewStruct(fields []*Var, tags []string) *Struct + func (s *Struct) Field(i int) *Var + func (s *Struct) NumFields() int + func (s *Struct) String() string + func (s *Struct) Tag(i int) string + func (s *Struct) Underlying() Type + type Term term + func NewTerm(tilde bool, typ Type) *Term + func (t *Term) String() string + func (t *Term) Tilde() bool + func (t *Term) Type() Type + type Tuple struct + func NewTuple(x ...*Var) *Tuple + func (t *Tuple) At(i int) *Var + func (t *Tuple) Len() int + func (t *Tuple) String() string + func (t *Tuple) Underlying() Type + type Type interface + String func() string + Underlying func() Type + func CoreType(t Type) Type + func Default(t Type) Type + func Instantiate(ctxt *Context, orig Type, targs []Type, validate bool) (Type, error) + type TypeAndValue struct + Type Type + Value constant.Value + func (tv TypeAndValue) Addressable() bool + func (tv TypeAndValue) Assignable() bool + func (tv TypeAndValue) HasOk() bool + func (tv TypeAndValue) IsBuiltin() bool + func (tv TypeAndValue) IsNil() bool + func (tv TypeAndValue) IsType() bool + func (tv TypeAndValue) IsValue() bool + func (tv TypeAndValue) IsVoid() bool + type TypeList struct + func (l *TypeList) At(i int) Type + func (l *TypeList) Len() int + type TypeName struct + func NewTypeName(pos syntax.Pos, pkg *Package, name string, typ Type) *TypeName + func NewTypeNameLazy(pos syntax.Pos, pkg *Package, name string, ...) *TypeName + func (obj *TypeName) Exported() bool + func (obj *TypeName) Id() string + func (obj *TypeName) IsAlias() bool + func (obj *TypeName) Name() string + func (obj *TypeName) Parent() *Scope + func (obj *TypeName) Pkg() *Package + func (obj *TypeName) Pos() syntax.Pos + func (obj *TypeName) String() string + func (obj *TypeName) Type() Type + type TypeParam struct + func NewTypeParam(obj *TypeName, constraint Type) *TypeParam + func (t *TypeParam) Constraint() Type + func (t *TypeParam) Index() int + func (t *TypeParam) Obj() *TypeName + func (t *TypeParam) SetConstraint(bound Type) + func (t *TypeParam) String() string + func (t *TypeParam) Underlying() Type + type TypeParamList struct + func (l *TypeParamList) At(i int) *TypeParam + func (l *TypeParamList) Len() int + type Union struct + func NewUnion(terms []*Term) *Union + func (u *Union) Len() int + func (u *Union) String() string + func (u *Union) Term(i int) *Term + func (u *Union) Underlying() Type + type Var struct + func NewField(pos syntax.Pos, pkg *Package, name string, typ Type, embedded bool) *Var + func NewParam(pos syntax.Pos, pkg *Package, name string, typ Type) *Var + func NewVar(pos syntax.Pos, pkg *Package, name string, typ Type) *Var + func (obj *Var) Anonymous() bool + func (obj *Var) Embedded() bool + func (obj *Var) Exported() bool + func (obj *Var) Id() string + func (obj *Var) IsField() bool + func (obj *Var) Name() string + func (obj *Var) Parent() *Scope + func (obj *Var) Pkg() *Package + func (obj *Var) Pos() syntax.Pos + func (obj *Var) String() string + func (obj *Var) Type() Type