MCPcopy
hub / github.com/google/go-cmp / tryMethod

Method tryMethod

cmp/compare.go:312–322  ·  view source on GitHub ↗
(t reflect.Type, vx, vy reflect.Value)

Source from the content-addressed store, hash-verified

310}
311
312func (s *state) tryMethod(t reflect.Type, vx, vy reflect.Value) bool {
313 // Check if this type even has an Equal method.
314 m, ok := t.MethodByName("Equal")
315 if !ok || !function.IsType(m.Type, function.EqualAssignable) {
316 return false
317 }
318
319 eq := s.callTTBFunc(m.Func, vx, vy)
320 s.report(eq, reportByMethod)
321 return true
322}
323
324func (s *state) callTRFunc(f, v reflect.Value, step Transform) reflect.Value {
325 if !s.dynChecker.Next() {

Callers 1

compareAnyMethod · 0.95

Calls 3

callTTBFuncMethod · 0.95
reportMethod · 0.95
IsTypeFunction · 0.92

Tested by

no test coverage detected