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

Method compareInterface

cmp/compare.go:569–580  ·  cmp/compare.go::state.compareInterface
(t reflect.Type, vx, vy reflect.Value)

Source from the content-addressed store, hash-verified

567}
568
569func (s *state) compareInterface(t reflect.Type, vx, vy reflect.Value) {
570 if vx.IsNil() || vy.IsNil() {
571 s.report(vx.IsNil() && vy.IsNil(), 0)
572 return
573 }
574 vx, vy = vx.Elem(), vy.Elem()
575 if vx.Type() != vy.Type() {
576 s.report(false, 0)
577 return
578 }
579 s.compareAny(TypeAssertion{&typeAssertion{pathStep{vx.Type(), vx, vy}}})
580}
581
582func (s *state) report(eq bool, rf resultFlags) {
583 if rf&reportByIgnore == 0 {

Callers 1

compareAnyMethod · 0.95

Calls 4

reportMethod · 0.95
compareAnyMethod · 0.95
IsNilMethod · 0.80
TypeMethod · 0.65

Tested by

no test coverage detected