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

Function Equal

proto/proto.go:160–162  ·  proto/proto.go::Equal

Equal reports whether two messages are equal. If two messages marshal to the same bytes under deterministic serialization, then Equal is guaranteed to report true. Two messages are equal if they are the same protobuf message type, have the same set of populated known and extension field values, and

(x, y Message)

Source from the content-addressed store, hash-verified

158// Maps are equal if they have the same set of keys, where the pair of values
159// for each key is also equal.
160func Equal(x, y Message) bool {
161 return protoV2.Equal(MessageV2(x), MessageV2(y))
162}
163
164func isMessageSet(md protoreflect.MessageDescriptor) bool {
165 ms, ok := md.(interface{ IsMessageSet() bool })

Callers 15

TestCloneFunction · 0.92
TestCloneNilFunction · 0.92
TestMergeFunction · 0.92
TestDiscardUnknownFunction · 0.92
TestEqualFunction · 0.92
anyEqualFunction · 0.92
TestStringEscapingFunction · 0.92
TestUnmarshalTextFunction · 0.92
TestRepeatedEnumFunction · 0.92
TestProto3TextParsingFunction · 0.92

Calls 1

MessageV2Function · 0.85

Tested by 15

TestCloneFunction · 0.74
TestCloneNilFunction · 0.74
TestMergeFunction · 0.74
TestDiscardUnknownFunction · 0.74
TestEqualFunction · 0.74
anyEqualFunction · 0.74
TestStringEscapingFunction · 0.74
TestUnmarshalTextFunction · 0.74
TestRepeatedEnumFunction · 0.74
TestProto3TextParsingFunction · 0.74