| 11 | ) |
| 12 | |
| 13 | func 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 | |
| 38 | func deepEqualValue(v1, v2 reflect.Value) bool { |
| 39 | t1 := v1.Type() |