Documentation ¶
Index ¶
- func All(typ types.Type, fn func(*types.Term) bool) bool
- func Any(typ types.Type, fn func(*types.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 *types.Term) bool
- func IsType(T types.Type, name string) bool
- type Field
- type Hasher
- type Iterator
- type Map
- func (m *Map[V]) At(key types.Type) (V, bool)
- func (m *Map[V]) Delete(key types.Type) bool
- func (m *Map[V]) Iterate(f func(key types.Type, value V))
- func (m *Map[V]) Keys() []types.Type
- func (m *Map[V]) KeysString() string
- func (m *Map[V]) Len() int
- func (m *Map[V]) Set(key types.Type, value V)
- func (m *Map[V]) SetHasher(h typeutil.Hasher)
- func (m *Map[V]) String() string
- 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 ¶
IsPointerLike returns true if type T is like a pointer. This returns true for all nillable types, unsafe.Pointer, and type sets where at least one term is pointer-like.
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 Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func NewIterator ¶
func (*Iterator) Underlying ¶
type Map ¶
type Map[V any] struct { // contains filtered or unexported fields }
func (*Map[V]) KeysString ¶
type MethodSetCache ¶
type MethodSetCache = typeutil.MethodSetCache
type TypeSet ¶
func NewTypeSet ¶
func (TypeSet) All ¶
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.