github.com/prysmaticlabs/prysm@v1.4.4/third_party/com_github_gogo_protobuf-equal.patch (about)

     1  diff --git a/proto/equal.go b/proto/equal.go
     2  index d4db5a1c..649100f9 100644
     3  --- a/proto/equal.go
     4  +++ b/proto/equal.go
     5  @@ -202,6 +202,15 @@ func equalAny(v1, v2 reflect.Value, prop *Properties) bool {
     6   			if v1.IsNil() != v2.IsNil() {
     7   				return false
     8   			}
     9  +			// Edge case: if field is a cast type of []byte, special conversion
    10  +			// to []byte is required for bytes.Equal.
    11  +			if v1.Type() != reflect.TypeOf([]byte{}) {
    12  +				w1 := reflect.New(reflect.TypeOf([]byte{})).Elem()
    13  +				w2 := reflect.New(reflect.TypeOf([]byte{})).Elem()
    14  +				w1.Set(v1)
    15  +				w2.Set(v2)
    16  +				return bytes.Equal(w1.Interface().([]byte), w2.Interface().([]byte))
    17  +			}
    18   			return bytes.Equal(v1.Interface().([]byte), v2.Interface().([]byte))
    19   		}
    20