Documentation
¶
Overview ¶
Package types provides a mockable wrapper for go/types.
Index ¶
- type Impl
- func (*Impl) AssertableTo(V *types.Interface, T types.Type) bool
- func (*Impl) AssignableTo(V types.Type, T types.Type) bool
- func (*Impl) CheckExpr(fset *token.FileSet, pkg *types.Package, pos token.Pos, expr ast.Expr, ...) (err error)
- func (*Impl) Comparable(T types.Type) bool
- func (*Impl) ConvertibleTo(V types.Type, T types.Type) bool
- func (*Impl) DefPredeclaredTestFuncs()
- func (*Impl) Default(t types.Type) types.Type
- func (*Impl) Eval(fset *token.FileSet, pkg *types.Package, pos token.Pos, expr string) (_ types.TypeAndValue, err error)
- func (*Impl) ExprString(x ast.Expr) string
- func (*Impl) Id(pkg *types.Package, name string) string
- func (*Impl) Identical(x types.Type, y types.Type) bool
- func (*Impl) IdenticalIgnoreTags(x types.Type, y types.Type) bool
- func (*Impl) Implements(V types.Type, T *types.Interface) bool
- func (*Impl) Instantiate(ctxt *types.Context, orig types.Type, targs []types.Type, validate bool) (types.Type, error)
- func (*Impl) IsInterface(t types.Type) bool
- func (*Impl) LookupFieldOrMethod(T types.Type, addressable bool, pkg *types.Package, name string) (obj types.Object, index []int, indirect bool)
- func (*Impl) MissingMethod(V types.Type, T *types.Interface, static bool) (method *types.Func, wrongType bool)
- func (*Impl) NewArray(elem types.Type, len int64) *types.Array
- func (*Impl) NewChan(dir types.ChanDir, elem types.Type) *types.Chan
- func (*Impl) NewChecker(conf *types.Config, fset *token.FileSet, pkg *types.Package, info *types.Info) *types.Checker
- func (*Impl) NewConst(pos token.Pos, pkg *types.Package, name string, typ types.Type, ...) *types.Const
- func (*Impl) NewContext() *types.Context
- func (*Impl) NewField(pos token.Pos, pkg *types.Package, name string, typ types.Type, embedded bool) *types.Var
- func (*Impl) NewFunc(pos token.Pos, pkg *types.Package, name string, sig *types.Signature) *types.Func
- func (*Impl) NewInterface(methods []*types.Func, embeddeds []*types.Named) *types.Interface
- func (*Impl) NewInterfaceType(methods []*types.Func, embeddeds []types.Type) *types.Interface
- func (*Impl) NewLabel(pos token.Pos, pkg *types.Package, name string) *types.Label
- func (*Impl) NewMap(key types.Type, elem types.Type) *types.Map
- func (*Impl) NewMethodSet(T types.Type) *types.MethodSet
- func (*Impl) NewNamed(obj *types.TypeName, underlying types.Type, methods []*types.Func) *types.Named
- func (*Impl) NewPackage(path string, name string) *types.Package
- func (*Impl) NewParam(pos token.Pos, pkg *types.Package, name string, typ types.Type) *types.Var
- func (*Impl) NewPkgName(pos token.Pos, pkg *types.Package, name string, imported *types.Package) *types.PkgName
- func (*Impl) NewPointer(elem types.Type) *types.Pointer
- func (*Impl) NewScope(parent *types.Scope, pos token.Pos, end token.Pos, comment string) *types.Scope
- func (*Impl) NewSignature(recv *types.Var, params *types.Tuple, results *types.Tuple, variadic bool) *types.Signature
- func (*Impl) NewSignatureType(recv *types.Var, recvTypeParams []*types.TypeParam, ...) *types.Signature
- func (*Impl) NewSlice(elem types.Type) *types.Slice
- func (*Impl) NewStruct(fields []*types.Var, tags []string) *types.Struct
- func (*Impl) NewTerm(tilde bool, typ types.Type) *types.Term
- func (*Impl) NewTuple(x ...*types.Var) *types.Tuple
- func (*Impl) NewTypeName(pos token.Pos, pkg *types.Package, name string, typ types.Type) *types.TypeName
- func (*Impl) NewTypeParam(obj *types.TypeName, constraint types.Type) *types.TypeParam
- func (*Impl) NewUnion(terms []*types.Term) *types.Union
- func (*Impl) NewVar(pos token.Pos, pkg *types.Package, name string, typ types.Type) *types.Var
- func (*Impl) ObjectString(obj types.Object, qf types.Qualifier) string
- func (*Impl) RelativeTo(pkg *types.Package) types.Qualifier
- func (*Impl) SelectionString(s *types.Selection, qf types.Qualifier) string
- func (*Impl) SizesFor(compiler string, arch string) types.Sizes
- func (*Impl) TypeString(typ types.Type, qf types.Qualifier) string
- func (*Impl) WriteExpr(buf *bytes.Buffer, x ast.Expr)
- func (*Impl) WriteSignature(buf *bytes.Buffer, sig *types.Signature, qf types.Qualifier)
- func (*Impl) WriteType(buf *bytes.Buffer, typ types.Type, qf types.Qualifier)
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct{}
func (*Impl) DefPredeclaredTestFuncs ¶
func (*Impl) DefPredeclaredTestFuncs()
func (*Impl) IdenticalIgnoreTags ¶
func (*Impl) Instantiate ¶
func (*Impl) LookupFieldOrMethod ¶
func (*Impl) MissingMethod ¶
func (*Impl) NewChecker ¶
func (*Impl) NewContext ¶
func (*Impl) NewInterface ¶
func (*Impl) NewInterfaceType ¶
func (*Impl) NewPkgName ¶
func (*Impl) NewSignature ¶
func (*Impl) NewSignatureType ¶
func (*Impl) NewTypeName ¶
func (*Impl) NewTypeParam ¶
func (*Impl) SelectionString ¶
func (*Impl) WriteSignature ¶
type Interface ¶
type Interface interface { AssertableTo(V *types.Interface, T types.Type) bool AssignableTo(V types.Type, T types.Type) bool CheckExpr(fset *token.FileSet, pkg *types.Package, pos token.Pos, expr ast.Expr, info *types.Info) (err error) Comparable(T types.Type) bool ConvertibleTo(V types.Type, T types.Type) bool DefPredeclaredTestFuncs() Default(t types.Type) types.Type Eval(fset *token.FileSet, pkg *types.Package, pos token.Pos, expr string) (_ types.TypeAndValue, err error) ExprString(x ast.Expr) string Id(pkg *types.Package, name string) string Identical(x types.Type, y types.Type) bool IdenticalIgnoreTags(x types.Type, y types.Type) bool Implements(V types.Type, T *types.Interface) bool Instantiate(ctxt *types.Context, orig types.Type, targs []types.Type, validate bool) (types.Type, error) IsInterface(t types.Type) bool LookupFieldOrMethod(T types.Type, addressable bool, pkg *types.Package, name string) (obj types.Object, index []int, indirect bool) MissingMethod(V types.Type, T *types.Interface, static bool) (method *types.Func, wrongType bool) NewArray(elem types.Type, len int64) *types.Array NewChan(dir types.ChanDir, elem types.Type) *types.Chan NewChecker(conf *types.Config, fset *token.FileSet, pkg *types.Package, info *types.Info) *types.Checker NewConst(pos token.Pos, pkg *types.Package, name string, typ types.Type, val constant.Value) *types.Const NewContext() *types.Context NewField(pos token.Pos, pkg *types.Package, name string, typ types.Type, embedded bool) *types.Var NewFunc(pos token.Pos, pkg *types.Package, name string, sig *types.Signature) *types.Func NewInterface(methods []*types.Func, embeddeds []*types.Named) *types.Interface NewInterfaceType(methods []*types.Func, embeddeds []types.Type) *types.Interface NewLabel(pos token.Pos, pkg *types.Package, name string) *types.Label NewMap(key types.Type, elem types.Type) *types.Map NewMethodSet(T types.Type) *types.MethodSet NewNamed(obj *types.TypeName, underlying types.Type, methods []*types.Func) *types.Named NewPackage(path string, name string) *types.Package NewParam(pos token.Pos, pkg *types.Package, name string, typ types.Type) *types.Var NewPkgName(pos token.Pos, pkg *types.Package, name string, imported *types.Package) *types.PkgName NewPointer(elem types.Type) *types.Pointer NewScope(parent *types.Scope, pos token.Pos, end token.Pos, comment string) *types.Scope NewSignature(recv *types.Var, params *types.Tuple, results *types.Tuple, variadic bool) *types.Signature NewSignatureType(recv *types.Var, recvTypeParams []*types.TypeParam, typeParams []*types.TypeParam, params *types.Tuple, results *types.Tuple, variadic bool) *types.Signature NewSlice(elem types.Type) *types.Slice NewStruct(fields []*types.Var, tags []string) *types.Struct NewTerm(tilde bool, typ types.Type) *types.Term NewTuple(x ...*types.Var) *types.Tuple NewTypeName(pos token.Pos, pkg *types.Package, name string, typ types.Type) *types.TypeName NewTypeParam(obj *types.TypeName, constraint types.Type) *types.TypeParam NewUnion(terms []*types.Term) *types.Union NewVar(pos token.Pos, pkg *types.Package, name string, typ types.Type) *types.Var ObjectString(obj types.Object, qf types.Qualifier) string RelativeTo(pkg *types.Package) types.Qualifier SelectionString(s *types.Selection, qf types.Qualifier) string SizesFor(compiler string, arch string) types.Sizes TypeString(typ types.Type, qf types.Qualifier) string WriteExpr(buf *bytes.Buffer, x ast.Expr) WriteSignature(buf *bytes.Buffer, sig *types.Signature, qf types.Qualifier) WriteType(buf *bytes.Buffer, typ types.Type, qf types.Qualifier) }
Click to show internal directories.
Click to hide internal directories.