MCPcopy
hub / github.com/livebud/bud / Receiver

Method Receiver

package/parser/function.go:36–56  ·  view source on GitHub ↗

Receiver returns the receiver field, if any

()

Source from the content-addressed store, hash-verified

34
35// Receiver returns the receiver field, if any
36func (fn *Function) Receiver() *Receiver {
37 if fn.node.Recv == nil {
38 return nil
39 }
40 if len(fn.node.Recv.List) == 0 {
41 return nil
42 }
43 field := fn.node.Recv.List[0]
44 names := field.Names
45 if len(names) == 0 {
46 return &Receiver{
47 fn: fn,
48 node: field,
49 }
50 }
51 return &Receiver{
52 fn: fn,
53 name: names[0].Name,
54 node: field,
55 }
56}
57
58// Params returns parameters
59func (fn *Function) Params() (fields []*Param) {

Callers 6

SignatureMethod · 0.95
loadProviderMethod · 0.80
tryFunctionFunction · 0.80
PublicMethodsMethod · 0.80
MethodsMethod · 0.80
PublicMethodsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected