typeutil

package
v0.3.0-0.dev Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 6 Imported by: 35

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 added in v0.2.0

type Hasher = typeutil.Hasher

func MakeHasher added in v0.2.0

func MakeHasher() Hasher

type Map added in v0.2.0

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