UnmarshalMerge parses a wire-format message in b and places the decoded results in m.
(b []byte, m Message)
| 60 | |
| 61 | // UnmarshalMerge parses a wire-format message in b and places the decoded results in m. |
| 62 | func UnmarshalMerge(b []byte, m Message) error { |
| 63 | mi := MessageV2(m) |
| 64 | out, err := protoV2.UnmarshalOptions{ |
| 65 | AllowPartial: true, |
| 66 | Merge: true, |
| 67 | }.UnmarshalState(protoiface.UnmarshalInput{ |
| 68 | Buf: b, |
| 69 | Message: mi.ProtoReflect(), |
| 70 | }) |
| 71 | if err != nil { |
| 72 | return err |
| 73 | } |
| 74 | if out.Flags&protoiface.UnmarshalInitialized > 0 { |
| 75 | return nil |
| 76 | } |
| 77 | return checkRequiredNotSet(mi) |
| 78 | } |