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

Function deepEqualStruct

protocol/prototest/prototest.go:73–93  ·  view source on GitHub ↗
(v1, v2 reflect.Value)

Source from the content-addressed store, hash-verified

71}
72
73func deepEqualStruct(v1, v2 reflect.Value) bool {
74 t := v1.Type()
75 n := t.NumField()
76
77 for i := 0; i < n; i++ {
78 f := t.Field(i)
79
80 if f.PkgPath != "" { // ignore unexported fields
81 continue
82 }
83
84 f1 := v1.Field(i)
85 f2 := v2.Field(i)
86
87 if !deepEqual(f1.Interface(), f2.Interface()) {
88 return false
89 }
90 }
91
92 return true
93}
94
95func deepEqualSlice(v1, v2 reflect.Value) bool {
96 t := v1.Type()

Callers 1

deepEqualValueFunction · 0.85

Calls 1

deepEqualFunction · 0.85

Tested by

no test coverage detected