File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,13 @@ import (
31
31
// - Maps are equal if they have the same set of keys and
32
32
// the corresponding value for each key is equal.
33
33
//
34
- // If two messages marshal to the same bytes under deterministic serialization,
35
- // then Equal is guaranteed to report true.
34
+ // An invalid message is not equal to a valid message.
35
+ // An invalid message is only equal to another invalid message of the
36
+ // same type. An invalid message often corresponds to a nil pointer
37
+ // of the concrete message type. For example, (*pb.M)(nil) is not equal
38
+ // to &pb.M{}.
39
+ // If two valid messages marshal to the same bytes under deterministic
40
+ // serialization, then Equal is guaranteed to report true.
36
41
func Equal (x , y Message ) bool {
37
42
if x == nil || y == nil {
38
43
return x == nil && y == nil
You can’t perform that action at this time.
0 commit comments