Documentation
¶
Index ¶
- func All(typ types.Type, fn func(*typeparams.Term) bool) bool
- func Any(typ types.Type, fn func(*typeparams.Term) bool) bool
- func Callee(info *types.Info, call *ast.CallExpr) types.Object
- func CoreType(typ types.Type) types.Type
- func Dereference(T types.Type) types.Type
- func DereferenceR(T types.Type) types.Type
- func FuncName(f *types.Func) string
- func IntuitiveMethodSet(T types.Type, msets *MethodSetCache) []*types.Selection
- func IsObject(obj types.Object, name string) bool
- func IsPointerLike(T types.Type) bool
- func IsSlice(term *typeparams.Term) bool
- func IsType(T types.Type, name string) bool
- type Field
- type Hasher
- type Iterator
- type Map
- type MethodSetCache
- type TypeSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dereference ¶
Dereference returns a pointer's element type; otherwise it returns T.
func DereferenceR ¶
DereferenceR returns a pointer's element type; otherwise it returns T. If the element type is itself a pointer, DereferenceR will be applied recursively.
func IntuitiveMethodSet ¶
func IntuitiveMethodSet(T types.Type, msets *MethodSetCache) []*types.Selection
func IsPointerLike ¶
func IsSlice ¶ added in v0.3.0
func IsSlice(term *typeparams.Term) bool
Types ¶
type Field ¶
func FlattenFields ¶
FlattenFields recursively flattens T and embedded structs, returning a list of fields. If multiple fields with the same name exist, all will be returned.
type Hasher ¶ added in v0.2.0
func MakeHasher ¶ added in v0.2.0
func MakeHasher() Hasher
type Iterator ¶ added in v0.3.0
type Iterator struct {
// contains filtered or unexported fields
}
func NewIterator ¶ added in v0.3.0
func (*Iterator) Underlying ¶ added in v0.3.0
type MethodSetCache ¶
type MethodSetCache = typeutil.MethodSetCache
type TypeSet ¶ added in v0.3.0
type TypeSet struct { Terms []*typeparams.Term // contains filtered or unexported fields }
func NewTypeSet ¶ added in v0.3.0
func (TypeSet) All ¶ added in v0.3.0
func (ts TypeSet) All(fn func(*typeparams.Term) bool) bool
All calls fn for each term in the type set and reports whether all invocations returned true. If the type set is empty or unconstrained, All immediately returns false.