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

Function Clone

proto/proto.go:129–131  ·  proto/proto.go::Clone

Clone returns a deep copy of src.

(src Message)

Source from the content-addressed store, hash-verified

127
128// Clone returns a deep copy of src.
129func Clone(src Message) Message {
130 return MessageV1(protoV2.Clone(MessageV2(src)))
131}
132
133// Merge merges src into dst, which must be messages of the same type.
134//

Callers 9

TestCloneFunction · 0.92
TestCloneNilFunction · 0.92
TestMergeFunction · 0.92
TestUnmarshalGoldenFunction · 0.92
TestInvalidUTF8Function · 0.92
TestProto3SetDefaultsFunction · 0.92

Calls 2

MessageV1Function · 0.85
MessageV2Function · 0.85

Tested by 8

TestCloneFunction · 0.74
TestCloneNilFunction · 0.74
TestMergeFunction · 0.74
TestUnmarshalGoldenFunction · 0.74
TestInvalidUTF8Function · 0.74
TestProto3SetDefaultsFunction · 0.74