mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-02-22 12:39:52 +00:00
encoding/textpb: fix failed tests due to ordering of marshaled binary fields
Added temporary work-around for now by always using deterninistic marshaling so that protoV1.Equals knows how to do comparison. Change-Id: Idec412647269d59f86ed3e485a1893c070355b3d Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/167917 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
parent
4d1c3be76f
commit
e0cf15babe
@ -486,7 +486,7 @@ func (o UnmarshalOptions) unmarshalAny(tfield [2]text.Value, knownFields pref.Kn
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Serialize the embedded message and assign the resulting bytes to the value field.
|
// Serialize the embedded message and assign the resulting bytes to the value field.
|
||||||
b, err := proto.Marshal(m.Interface())
|
b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m.Interface())
|
||||||
if !nerr.Merge(err) {
|
if !nerr.Merge(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -1327,7 +1327,7 @@ value: "some bytes"
|
|||||||
OptString: scalar.String("inception"),
|
OptString: scalar.String("inception"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
b, err := proto.Marshal(m)
|
b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
|
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user