package
0.7.0
Repository: https://github.com/google/go-cmp.git
Documentation: pkg.go.dev

# Packages

Package cmpopts provides common options for the cmp package.

# Functions

AllowUnexported returns an [Option] that allows [Equal] to forcibly introspect unexported fields of the specified struct types.
Comparer returns an [Option] that determines whether two values are equal to each other.
Diff returns a human-readable report of the differences between two values: y - x.
Equal reports whether x and y are equal by recursively applying the following rules in the given order to x and y and all of their sub-values: - Let S be the set of all [Ignore], [Transformer], and [Comparer] options that remain after applying all path filters, value filters, and type filters.
Exporter returns an [Option] that specifies whether [Equal] is allowed to introspect into the unexported fields of certain struct types.
FilterPath returns a new [Option] where opt is only evaluated if filter f returns true for the current [Path] in the value tree.
FilterValues returns a new [Option] where opt is only evaluated if filter f, which is a function of the form "func(T, T) bool", returns true for the current pair of values being compared.
Ignore is an [Option] that causes all comparisons to be ignored.
Reporter is an [Option] that can be passed to [Equal].
Transformer returns an [Option] that applies a transformation function that converts values of a certain type into that of another.

# Structs

Indirect is a [PathStep] that represents pointer indirection on the parent type.
MapIndex is a [PathStep] that represents an index operation on a map at some index Key.
Result represents the comparison result for a single node and is provided by cmp when calling Report (see [Reporter]).
SliceIndex is a [PathStep] that represents an index operation on a slice or array at some index [SliceIndex.Key].
StructField is a [PathStep] that represents a struct field access on a field called [StructField.Name].
Transform is a [PathStep] that represents a transformation from the parent type to the current type.
TypeAssertion is a [PathStep] that represents a type assertion on an interface.

# Interfaces

Option configures for specific behavior of [Equal] and [Diff].
PathStep is a union-type for specific operations to traverse a value's tree structure.

# Type aliases

Options is a list of [Option] values that also satisfies the [Option] interface.
Path is a list of [PathStep] describing the sequence of operations to get from some root type to the current position in the value tree.