Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepEqual ¶
DeepEqual is a wrapper around reflect.DeepEqual, which first checks if arguments implement CustomEquality. If they do, their Equals method is used for comparison instead of reflect.DeepEqual. For simplicity, DeepEqual requires x and y to be of the same type before calling CustomEquality.Equals. NOTE: structs, slices, maps and arrays that contain a mix of values implementing CustomEquality and not implementing it are not supported. Unexported fields are not supported either. In those cases, implement CustomEquality on higher level of your object hierarchy.
Types ¶
type CustomEquality ¶
CustomEquality allows to define custom Equals implementation. This can be used, for example, with exported types, so that the Runtime can short-circuit propagating updates when it is not necessary. If a struct is passed to DeepEqual, the `other` supplied to Equals will be a pointer. See tests for reference.