typeutil

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Callee

func Callee(info *types.Info, call *ast.CallExpr) types.Object

func Dereference

func Dereference(T types.Type) types.Type

Dereference returns a pointer's element type; otherwise it returns T.

func DereferenceR

func DereferenceR(T types.Type) types.Type

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 FuncName

func FuncName(f *types.Func) string

func IntuitiveMethodSet

func IntuitiveMethodSet(T types.Type, msets *MethodSetCache) []*types.Selection

func IsObject

func IsObject(obj types.Object, name string) bool

func IsPointerLike

func IsPointerLike(T types.Type) bool

func IsType

func IsType(T types.Type, name string) bool

OPT(dh): IsType is kind of expensive; should we really use it?

Types

type Field

type Field struct {
	Var  *types.Var
	Tag  string
	Path []int
}

func FlattenFields

func FlattenFields(T *types.Struct) []Field

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

type Hasher = typeutil.Hasher

func MakeHasher

func MakeHasher() Hasher

type Iterator

type Iterator struct {
	// contains filtered or unexported fields
}

func NewIterator

func NewIterator(elem types.Type) *Iterator

func (*Iterator) Elem

func (t *Iterator) Elem() types.Type

func (*Iterator) String

func (t *Iterator) String() string

func (*Iterator) Underlying

func (t *Iterator) Underlying() types.Type

type Map

type Map = typeutil.Map

type MethodSetCache

type MethodSetCache = typeutil.MethodSetCache

Jump to

Keyboard shortcuts

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