If iterates on the error's causal chain and returns a predicate's return value the first time the predicate returns true. Note: if any of the error types has been migrated from a previous package location or a different type, ensure that RegisterTypeMigration() was called prior to If().
(err error, pred func(err error) (interface{}, bool))
| 53 | // package location or a different type, ensure that |
| 54 | // RegisterTypeMigration() was called prior to If(). |
| 55 | func If(err error, pred func(err error) (interface{}, bool)) (interface{}, bool) { |
| 56 | return markers.If(err, pred) |
| 57 | } |
| 58 | |
| 59 | // IsAny is like Is except that multiple references are compared. |
| 60 | // |