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.
()
| 136 | // if [errors.Is] reports them to match. The [AnyError] error can be used to |
| 137 | // match any non-nil error. |
| 138 | func 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 |