types

package
v0.0.0-...-fab57c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package types provides a mockable wrapper for go/types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct{}

func (*Impl) AssertableTo

func (*Impl) AssertableTo(V *types.Interface, T types.Type) bool

func (*Impl) AssignableTo

func (*Impl) AssignableTo(V types.Type, T types.Type) bool

func (*Impl) CheckExpr

func (*Impl) CheckExpr(fset *token.FileSet, pkg *types.Package, pos token.Pos, expr ast.Expr, info *types.Info) (err error)

func (*Impl) Comparable

func (*Impl) Comparable(T types.Type) bool

func (*Impl) ConvertibleTo

func (*Impl) ConvertibleTo(V types.Type, T types.Type) bool

func (*Impl) DefPredeclaredTestFuncs

func (*Impl) DefPredeclaredTestFuncs()

func (*Impl) Default

func (*Impl) Default(t types.Type) types.Type

func (*Impl) Eval

func (*Impl) Eval(fset *token.FileSet, pkg *types.Package, pos token.Pos, expr string) (_ types.TypeAndValue, err error)

func (*Impl) ExprString

func (*Impl) ExprString(x ast.Expr) string

func (*Impl) Id

func (*Impl) Id(pkg *types.Package, name string) string

func (*Impl) Identical

func (*Impl) Identical(x types.Type, y types.Type) bool

func (*Impl) IdenticalIgnoreTags

func (*Impl) IdenticalIgnoreTags(x types.Type, y types.Type) bool

func (*Impl) Implements

func (*Impl) Implements(V types.Type, T *types.Interface) bool

func (*Impl) Instantiate

func (*Impl) Instantiate(ctxt *types.Context, orig types.Type, targs []types.Type, validate bool) (types.Type, error)

func (*Impl) IsInterface

func (*Impl) IsInterface(t types.Type) bool

func (*Impl) LookupFieldOrMethod

func (*Impl) LookupFieldOrMethod(T types.Type, addressable bool, pkg *types.Package, name string) (obj types.Object, index []int, indirect bool)

func (*Impl) MissingMethod

func (*Impl) MissingMethod(V types.Type, T *types.Interface, static bool) (method *types.Func, wrongType bool)

func (*Impl) NewArray

func (*Impl) NewArray(elem types.Type, len int64) *types.Array

func (*Impl) NewChan

func (*Impl) NewChan(dir types.ChanDir, elem types.Type) *types.Chan

func (*Impl) NewChecker

func (*Impl) NewChecker(conf *types.Config, fset *token.FileSet, pkg *types.Package, info *types.Info) *types.Checker

func (*Impl) NewConst

func (*Impl) NewConst(pos token.Pos, pkg *types.Package, name string, typ types.Type, val constant.Value) *types.Const

func (*Impl) NewContext

func (*Impl) NewContext() *types.Context

func (*Impl) NewField

func (*Impl) NewField(pos token.Pos, pkg *types.Package, name string, typ types.Type, embedded bool) *types.Var

func (*Impl) NewFunc

func (*Impl) NewFunc(pos token.Pos, pkg *types.Package, name string, sig *types.Signature) *types.Func

func (*Impl) NewInterface

func (*Impl) NewInterface(methods []*types.Func, embeddeds []*types.Named) *types.Interface

func (*Impl) NewInterfaceType

func (*Impl) NewInterfaceType(methods []*types.Func, embeddeds []types.Type) *types.Interface

func (*Impl) NewLabel

func (*Impl) NewLabel(pos token.Pos, pkg *types.Package, name string) *types.Label

func (*Impl) NewMap

func (*Impl) NewMap(key types.Type, elem types.Type) *types.Map

func (*Impl) NewMethodSet

func (*Impl) NewMethodSet(T types.Type) *types.MethodSet

func (*Impl) NewNamed

func (*Impl) NewNamed(obj *types.TypeName, underlying types.Type, methods []*types.Func) *types.Named

func (*Impl) NewPackage

func (*Impl) NewPackage(path string, name string) *types.Package

func (*Impl) NewParam

func (*Impl) NewParam(pos token.Pos, pkg *types.Package, name string, typ types.Type) *types.Var

func (*Impl) NewPkgName

func (*Impl) NewPkgName(pos token.Pos, pkg *types.Package, name string, imported *types.Package) *types.PkgName

func (*Impl) NewPointer

func (*Impl) NewPointer(elem types.Type) *types.Pointer

func (*Impl) NewScope

func (*Impl) NewScope(parent *types.Scope, pos token.Pos, end token.Pos, comment string) *types.Scope

func (*Impl) NewSignature

func (*Impl) NewSignature(recv *types.Var, params *types.Tuple, results *types.Tuple, variadic bool) *types.Signature

func (*Impl) NewSignatureType

func (*Impl) NewSignatureType(recv *types.Var, recvTypeParams []*types.TypeParam, typeParams []*types.TypeParam, params *types.Tuple, results *types.Tuple, variadic bool) *types.Signature

func (*Impl) NewSlice

func (*Impl) NewSlice(elem types.Type) *types.Slice

func (*Impl) NewStruct

func (*Impl) NewStruct(fields []*types.Var, tags []string) *types.Struct

func (*Impl) NewTerm

func (*Impl) NewTerm(tilde bool, typ types.Type) *types.Term

func (*Impl) NewTuple

func (*Impl) NewTuple(x ...*types.Var) *types.Tuple

func (*Impl) NewTypeName

func (*Impl) NewTypeName(pos token.Pos, pkg *types.Package, name string, typ types.Type) *types.TypeName

func (*Impl) NewTypeParam

func (*Impl) NewTypeParam(obj *types.TypeName, constraint types.Type) *types.TypeParam

func (*Impl) NewUnion

func (*Impl) NewUnion(terms []*types.Term) *types.Union

func (*Impl) NewVar

func (*Impl) NewVar(pos token.Pos, pkg *types.Package, name string, typ types.Type) *types.Var

func (*Impl) ObjectString

func (*Impl) ObjectString(obj types.Object, qf types.Qualifier) string

func (*Impl) RelativeTo

func (*Impl) RelativeTo(pkg *types.Package) types.Qualifier

func (*Impl) SelectionString

func (*Impl) SelectionString(s *types.Selection, qf types.Qualifier) string

func (*Impl) SizesFor

func (*Impl) SizesFor(compiler string, arch string) types.Sizes

func (*Impl) TypeString

func (*Impl) TypeString(typ types.Type, qf types.Qualifier) string

func (*Impl) WriteExpr

func (*Impl) WriteExpr(buf *bytes.Buffer, x ast.Expr)

func (*Impl) WriteSignature

func (*Impl) WriteSignature(buf *bytes.Buffer, sig *types.Signature, qf types.Qualifier)

func (*Impl) WriteType

func (*Impl) WriteType(buf *bytes.Buffer, typ types.Type, qf types.Qualifier)

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL