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

Function Unmarshal

proto/wire.go:56–59  ·  proto/wire.go::Unmarshal

Unmarshal parses a wire-format message in b and places the decoded results in m. Unmarshal resets m before starting to unmarshal, so any existing data in m is always removed. Use UnmarshalMerge to preserve and append to existing data.

(b []byte, m Message)

Source from the content-addressed store, hash-verified

54// Unmarshal resets m before starting to unmarshal, so any existing data in m is always
55// removed. Use UnmarshalMerge to preserve and append to existing data.
56func Unmarshal(b []byte, m Message) error {
57 m.Reset()
58 return UnmarshalMerge(b, m)
59}
60
61// UnmarshalMerge parses a wire-format message in b and places the decoded results in m.
62func UnmarshalMerge(b []byte, m Message) error {

Callers 15

TestMarshalRaceFunction · 0.92
TestCloneFunction · 0.92
initFunction · 0.92
TestEncodeDecodeBytes1Function · 0.92
TestEncodeDecodeBytes2Function · 0.92
TestNegativeInt32Function · 0.92

Calls 2

UnmarshalMergeFunction · 0.85
ResetMethod · 0.45

Tested by 15

TestMarshalRaceFunction · 0.74
TestCloneFunction · 0.74
initFunction · 0.74
TestEncodeDecodeBytes1Function · 0.74
TestEncodeDecodeBytes2Function · 0.74
TestNegativeInt32Function · 0.74