MCPcopy
hub / github.com/segmentio/kafka-go / deepEqual

Function deepEqual

protocol/prototest/prototest.go:13–36  ·  view source on GitHub ↗
(x1, x2 interface{})

Source from the content-addressed store, hash-verified

11)
12
13func deepEqual(x1, x2 interface{}) bool {
14 if x1 == nil {
15 return x2 == nil
16 }
17 if r1, ok := x1.(protocol.RecordReader); ok {
18 if r2, ok := x2.(protocol.RecordReader); ok {
19 return deepEqualRecords(r1, r2)
20 }
21 return false
22 }
23 if b1, ok := x1.(protocol.Bytes); ok {
24 if b2, ok := x2.(protocol.Bytes); ok {
25 return deepEqualBytes(b1, b2)
26 }
27 return false
28 }
29 if t1, ok := x1.(time.Time); ok {
30 if t2, ok := x2.(time.Time); ok {
31 return t1.Equal(t2)
32 }
33 return false
34 }
35 return deepEqualValue(reflect.ValueOf(x1), reflect.ValueOf(x2))
36}
37
38func deepEqualValue(v1, v2 reflect.Value) bool {
39 t1 := v1.Type()

Callers 7

TestRequestFunction · 0.85
TestRequestWithOverrideFunction · 0.85
deepEqualPtrFunction · 0.85
deepEqualStructFunction · 0.85
deepEqualSliceFunction · 0.85
deepEqualRecordFunction · 0.85
TestResponseFunction · 0.85

Calls 3

deepEqualRecordsFunction · 0.85
deepEqualBytesFunction · 0.85
deepEqualValueFunction · 0.85

Tested by 3

TestRequestFunction · 0.68
TestRequestWithOverrideFunction · 0.68
TestResponseFunction · 0.68