MCPcopy
hub / github.com/golang/protobuf / UnmarshalMerge

Function UnmarshalMerge

proto/wire.go:62–78  ·  proto/wire.go::UnmarshalMerge

UnmarshalMerge parses a wire-format message in b and places the decoded results in m.

(b []byte, m Message)

Source from the content-addressed store, hash-verified

60
61// UnmarshalMerge parses a wire-format message in b and places the decoded results in m.
62func 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}

Callers 5

TestMergeMessagesFunction · 0.92
UnmarshalFunction · 0.85
UnmarshalMethod · 0.85
DecodeMessageMethod · 0.85
DecodeGroupMethod · 0.85

Calls 3

MessageV2Function · 0.85
checkRequiredNotSetFunction · 0.85
ProtoReflectMethod · 0.80

Tested by 1

TestMergeMessagesFunction · 0.74