compare

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 4 Imported by: 0

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

func Equal(a, b any) bool

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.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL