MCPcopy
hub / github.com/google/go-cmp / EquateErrors

Function EquateErrors

cmp/cmpopts/equate.go:138–140  ·  view source on GitHub ↗

EquateErrors returns a [cmp.Comparer] option that determines errors to be equal if [errors.Is] reports them to match. The [AnyError] error can be used to match any non-nil error.

()

Source from the content-addressed store, hash-verified

136// if [errors.Is] reports them to match. The [AnyError] error can be used to
137// match any non-nil error.
138func EquateErrors() cmp.Option {
139 return cmp.FilterValues(areConcreteErrors, cmp.Comparer(compareErrors))
140}
141
142// areConcreteErrors reports whether x and y are types that implement error.
143// The input types are deliberately of the interface{} type rather than the

Callers 2

comparerTestsFunction · 0.92
TestOptionsFunction · 0.85

Calls 2

FilterValuesFunction · 0.92
ComparerFunction · 0.92

Tested by 2

comparerTestsFunction · 0.74
TestOptionsFunction · 0.68