MCPcopy Create free account
hub / github.com/alecthomas/kong / getExplicitMethod

Function getExplicitMethod

callbacks.go:131–139  ·  view source on GitHub ↗
(value reflect.Value, name string)

Source from the content-addressed store, hash-verified

129}
130
131func getExplicitMethod(value reflect.Value, name string) reflect.Value {
132 if isExplicitMethod(value.Type(), name) {
133 return value.MethodByName(name)
134 }
135 if value.CanAddr() && isExplicitMethod(value.Addr().Type(), name) {
136 return value.Addr().MethodByName(name)
137 }
138 return reflect.Value{}
139}
140
141func isExplicitMethod(t reflect.Type, name string) bool {
142 method, ok := t.MethodByName(name)

Callers 1

getMethodsFunction · 0.85

Calls 1

isExplicitMethodFunction · 0.85

Tested by

no test coverage detected