MCPcopy Create free account
hub / github.com/despiteallobjections/amigo / LookupMethod

Method LookupMethod

types/methods.go:45–51  ·  view source on GitHub ↗

LookupMethod returns the implementation of the method of type T identified by (pkg, name). It returns nil if the method exists but is abstract, and panics if T has no such method.

(T Type, pkg *Package, name string)

Source from the content-addressed store, hash-verified

43// is abstract, and panics if T has no such method.
44//
45func (prog *Program) LookupMethod(T Type, pkg *Package, name string) *Function {
46 sel := prog.MethodSets.MethodSet(T).Lookup(pkg, name)
47 if sel == nil {
48 panic(fmt.Sprintf("%s has no method %s", T, Id(pkg, name)))
49 }
50 return prog.MethodValue(sel)
51}
52
53// ssaMethodSet contains the (concrete) methods of a non-interface type.
54type ssaMethodSet struct {

Callers 3

lookupFieldOrMethodFunction · 0.45
missingMethodMethod · 0.45
lookupMethodFunction · 0.45

Calls 4

MethodValueMethod · 0.95
IdFunction · 0.85
MethodSetMethod · 0.80
LookupMethod · 0.45

Tested by

no test coverage detected