|
|
@@ -178,11 +178,8 @@ func (o MarshalOptions) marshalAny(m pref.Message) error {
|
|
|
}
|
|
|
|
|
|
em := emt.New()
|
|
|
- // TODO: If binary unmarshaling returns required not set error, need to
|
|
|
- // return another required not set error that contains both the path to this
|
|
|
- // field and the path inside the embedded message.
|
|
|
err = proto.UnmarshalOptions{
|
|
|
- AllowPartial: o.AllowPartial,
|
|
|
+ AllowPartial: true, // never check required fields inside an Any
|
|
|
Resolver: o.Resolver,
|
|
|
}.Unmarshal(valueVal.Bytes(), em.Interface())
|
|
|
if !nerr.Merge(err) {
|
|
|
@@ -253,11 +250,8 @@ func (o UnmarshalOptions) unmarshalAny(m pref.Message) error {
|
|
|
}
|
|
|
// Serialize the embedded message and assign the resulting bytes to the
|
|
|
// proto value field.
|
|
|
- // TODO: If binary marshaling returns required not set error, need to return
|
|
|
- // another required not set error that contains both the path to this field
|
|
|
- // and the path inside the embedded message.
|
|
|
b, err := proto.MarshalOptions{
|
|
|
- AllowPartial: o.AllowPartial,
|
|
|
+ AllowPartial: true, // never check required fields inside an Any
|
|
|
Deterministic: true,
|
|
|
}.Marshal(em.Interface())
|
|
|
if !nerr.Merge(err) {
|