type go/types.Func
124 uses
go/types (current package)
builtins.go#L793: case *Func:
call.go#L760: case *Func:
call.go#L843: if m, _ := obj.(*Func); m != nil {
call.go#L849: m, _ := obj.(*Func)
call.go#L906: case *Func:
check.go#L195: methods map[*TypeName][]*Func // maps package scope type names to associated non-blank (non-interface) methods
decl.go#L112: case *Func:
decl.go#L161: case *Func:
decl.go#L226: case *Func:
decl.go#L799: _ = alt.(*Func)
decl.go#L813: func (check *Checker) funcDecl(obj *Func, decl *declInfo) {
errsupport.go#L89: case *Func:
initorder.go#L256: if _, ok := n.obj.(*Func); ok {
interface.go#L19: methods []*Func // ordered list of explicitly declared methods
interface.go#L39: func NewInterface(methods []*Func, embeddeds []*Named) *Interface {
interface.go#L53: func NewInterfaceType(methods []*Func, embeddeds []Type) *Interface {
interface.go#L98: func (t *Interface) ExplicitMethod(i int) *Func { return t.methods[i] }
interface.go#L117: func (t *Interface) Method(i int) *Func { return t.typeSet().Method(i) }
iter.go#L20: func (t *Interface) Methods() iter.Seq[*Func] {
iter.go#L21: return func(yield func(m *Func) bool) {
iter.go#L34: func (t *Interface) ExplicitMethods() iter.Seq[*Func] {
iter.go#L35: return func(yield func(m *Func) bool) {
iter.go#L60: func (t *Named) Methods() iter.Seq[*Func] {
iter.go#L61: return func(yield func(m *Func) bool) {
lookup.go#L43: case *Func:
lookup.go#L105: if _, ok := obj.(*Func); ok {
lookup.go#L260: if f, _ := obj.(*Func); f != nil {
lookup.go#L365: func MissingMethod(V Type, T *Interface, static bool) (method *Func, wrongType bool) {
lookup.go#L378: func (check *Checker) missingMethod(V, T Type, static bool, equivalent func(x, y Type) bool, cause *string) (method *Func, wrongType bool) {
lookup.go#L396: var m *Func // method on T we're trying to implement
lookup.go#L397: var f *Func // method on V, if found (state is one of ok, wrongName, wrongSig)
lookup.go#L431: f, _ = obj.(*Func)
lookup.go#L445: f, _ = obj.(*Func)
lookup.go#L570: func (check *Checker) funcString(f *Func, pkgInfo bool) string {
lookup.go#L666: func methodIndex(methods []*Func, pkg *Package, name string, foldCase bool) (int, *Func) {
methodset.go#L218: func (s methodSet) add(list []*Func, index []int, indirect bool, multiples bool) methodSet {
methodset.go#L228: func (s methodSet) addOne(f *Func, index []int, indirect bool, multiples bool) methodSet {
named.go#L130: methods []*Func
named.go#L133: loader func(*Named) ([]*TypeParam, Type, []*Func, []func())
named.go#L191: func NewNamed(obj *TypeName, underlying Type, methods []*Func) *Named {
named.go#L323: func (check *Checker) newNamed(obj *TypeName, fromRHS Type, methods []*Func) *Named {
named.go#L426: func (t *Named) Method(i int) *Func {
named.go#L441: t.methods = make([]*Func, len(orig.methods))
named.go#L462: func (t *Named) expandMethod(i int) *Func {
named.go#L545: func (t *Named) AddMethod(m *Func) {
named.go#L690: func (n *Named) lookupMethod(pkg *Package, name string, foldCase bool) (int, *Func) {
object.go#L259: func _NewTypeNameLazy(pos token.Pos, pkg *Package, name string, load func(*Named) ([]*TypeParam, Type, []*Func, []func())) *TypeName {
object.go#L400: type Func struct {
object.go#L403: origin *Func // if non-nil, the Func from which this one was instantiated
object.go#L408: func NewFunc(pos token.Pos, pkg *Package, name string, sig *Signature) *Func {
object.go#L418: return &Func{object{nil, pos, pkg, name, typ, 0, nopos}, false, nil}
object.go#L422: func (obj *Func) Signature() *Signature {
object.go#L439: func (obj *Func) FullName() string {
object.go#L448: func (obj *Func) Scope() *Scope { return obj.typ.(*Signature).scope }
object.go#L457: func (obj *Func) Origin() *Func {
object.go#L468: func (obj *Func) Pkg() *Package { return obj.object.Pkg() }
object.go#L471: func (obj *Func) hasPtrRecv() bool {
object.go#L489: func (*Func) isDependency() {} // a function may be a dependency of an initialization expression
object.go#L548: case *Func:
object.go#L650: func (obj *Func) String() string { return ObjectString(obj, nil) }
object.go#L655: func writeFuncName(buf *bytes.Buffer, f *Func, qf Qualifier) {
object.go#L708: case *Func:
resolver.go#L231: obj *Func // method
resolver.go#L490: check.methods = make(map[*TypeName][]*Func)
selection.go#L100: sig := *s.obj.(*Func).typ.(*Signature)
selection.go#L111: sig := *s.obj.(*Func).typ.(*Signature)
subst.go#L332: func (subst *subster) func_(f *Func) *Func {
subst.go#L341: func cloneFunc(f *Func, typ Type) *Func {
subst.go#L361: func replaceRecvType(in []*Func, old, new Type) (out []*Func, copied bool) {
subst.go#L370: out = make([]*Func, len(in))
typeset.go#L30: methods []*Func // all methods of the interface; sorted by unique ID
typeset.go#L59: func (s *_TypeSet) Method(i int) *Func { return s.methods[i] }
typeset.go#L62: func (s *_TypeSet) LookupMethod(pkg *Package, name string, foldCase bool) (int, *Func) {
typeset.go#L221: var allMethods []*Func
typeset.go#L222: mpos := make(map[*Func]token.Pos) // method specification or method embedding position, for good error messages
typeset.go#L223: addMethod := func(pos token.Pos, m *Func, explicit bool) {
typeset.go#L232: err.addf(atPos(mpos[other.(*Func)]), "other declaration of method %s", m.name)
typeset.go#L246: err.addf(atPos(mpos[other.(*Func)]), "other declaration of method %s", m.name)
typeset.go#L351: func compareFunc(a, b *Func) int {
typeset.go#L355: func sortMethods(list []*Func) {
typeset.go#L359: func assertSortedMethods(list []*Func) {
typexpr.go#L130: case *Func:
unify.go#L516: ymap := make(map[string]*Func, len(ymethods))
unify.go#L543: if ym, _ := obj.(*Func); ym == nil || !u.nify(xm.typ, ym.typ, exact, p) {
universe.go#L128: ityp := &Interface{methods: []*Func{err}, complete: true}
go.pact.im/x/plumb/internal/discover
discover.go#L263: obj, _ := pkg.Info.Defs[fd.Name].(*types.Func)
discover.go#L729: obj, _ := pkg.Info.Defs[ident].(*types.Func)
provider.go#L78: Fn *types.Func // KindFunc, KindMethod
go.pact.im/x/plumb/internal/emit
name.go#L104: func cleanupBaseName(fn *types.Func) string {
go.pact.im/x/plumb/internal/gotypes
subst.go#L61: var methods []*types.Func
go.pact.im/x/plumb/internal/solve
instance.go#L268: func lookupMethod(named *types.Named, name string) *types.Func {
golang.org/x/exp/apidiff
apidiff.go#L250: case *types.Func:
apidiff.go#L252: case *types.Func:
apidiff.go#L296: case *types.Func:
compatibility.go#L127: func unexportedMethod(t *types.Interface) *types.Func {
compatibility.go#L347: return method.(*types.Func).Signature().Recv().Type()
correspondence.go#L273: func (d *differ) sortedMethods(iface *types.Interface) []*types.Func {
correspondence.go#L274: ms := make([]*types.Func, iface.NumMethods())
correspondence.go#L282: func (d *differ) methodID(m *types.Func) string {
messageset.go#L90: if f, ok := obj.(*types.Func); ok {
golang.org/x/tools/go/types/objectpath
objectpath.go#L147: seenMethods map[*types.Func]bool // global cycle breaking through recursive interfaces
objectpath.go#L308: case *types.Func:
objectpath.go#L498: tr.seenMethods = make(map[*types.Func]bool)
objectpath.go#L638: func (enc *Encoder) concreteMethod(meth *types.Func) (Path, bool) {
golang.org/x/tools/go/types/typeutil
callee.go#L37: func StaticCallee(info *types.Info, call *ast.CallExpr) *types.Func {
callee.go#L39: fn, _ := obj.(*types.Func)
callee.go#L83: func interfaceMethod(f *types.Func) bool {
golang.org/x/tools/internal/gcimporter
iexport.go#L714: case *types.Func:
iimport.go#L954: methods := make([]*types.Func, r.uint64())
iimport.go#L956: var method *types.Func
iimport.go#L958: method, _ = r.objectPathObject().(*types.Func)
ureader.go#L419: methods := make([]*types.Func, r.Len())
ureader.go#L585: methods := make([]*types.Func, iface.NumExplicitMethods())
ureader.go#L769: func (r *reader) method() *types.Func {
golang.org/x/tools/internal/typesinternal
classify_call.go#L78: case *types.Func:
classify_call.go#L137: func interfaceMethod(f *types.Func) bool
isnamed.go#L47: f, ok := obj.(*types.Func)
isnamed.go#L62: if fn, ok := obj.(*types.Func); ok {
types.go#L231: case *types.Func: