Skip to content

Message and Field Equality Functions #116

Description

@krishishah

For testing purposes it'd be really valuable to have message and field equality functions.

Currently, in order to check whether two messages are equal, we are forced to manually assert on every field (including nil ones) to ensure that every value is equal.

It would be great to have equality functions for messages that recursively check that fields and subfields are either nil or have equal values.

The same should be possible on a field / subfield level as well. This likely requires us to extend the field.Field interface to have an Equal(Field) bool function as well.

For the Message object, we could either add on a Equal(m *Message) bool method onto the *Message receiver or add on a utility function along the lines of: func Equal(x *Message, y *Message) bool

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions