Documentation
¶
Overview ¶
Package compare provides a shared equality comparison function with support for protocol buffers messages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
Equal returns true if a and b are considered equal.
If both a and b implement proto.Message, they are compared using proto.Equal.
Otherwise, they are compared using semantics equivalent to reflect.DeepEqual, except that function values are compared by their definition site rather than by pointer identity.
This non-standard behavior for functions is necessary to support comparison of handler state that contains function values, which are commonly used for stubbing in tests. Equal is used throughout testkit for comparison of [dogma.Message], [dogma.AggregateRoot] and [dogma.ProcessRoot] state; none of which are expected to contain function value in production implementations.
Types ¶
This section is empty.