// Equal reports whether v1 and v2 are recursively equal. // // - Values of different types are always unequal. // // - Bytes values are equal if they contain identical bytes. // Empty bytes (regardless of nil-ness) are considered equal. // // - Floating point values are equal if they contain the same value. // Unlike the == operator, a NaN is equal to another NaN. // // - Enums are equal if they contain the same number. // Since [Value] does not contain an enum descriptor, // enum values do not consider the type of the enum. // // - Other scalar values are equal if they contain the same value. // // - [Message] values are equal if they belong to the same message descriptor, // have the same set of populated known and extension field values, // and the same set of unknown fields values. // // - [List] values are equal if they are the same length and // each corresponding element is equal. // // - [Map] values are equal if they have the same set of keys and // the corresponding value for each key is equal. func (v1 Value) Equal(v2 Value) bool { … } func equalValue(x, y Value) bool { … } // equalFloat compares two floats, where NaNs are treated as equal. func equalFloat(x, y float64) bool { … } // equalMessage compares two messages. func equalMessage(mx, my Message) bool { … } // equalList compares two lists. func equalList(x, y List) bool { … } // equalMap compares two maps. func equalMap(x, y Map) bool { … } // equalUnknown compares unknown fields by direct comparison on the raw bytes // of each individual field number. func equalUnknown(x, y RawFields) bool { … }