ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. This is a wrapper for errors.As.
(t TestingT, err error, target interface{}, msg string, args ...interface{})
| 131 | // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. |
| 132 | // This is a wrapper for errors.As. |
| 133 | func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) bool { |
| 134 | if h, ok := t.(tHelper); ok { |
| 135 | h.Helper() |
| 136 | } |
| 137 | return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...) |
| 138 | } |
| 139 | |
| 140 | // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) |
| 141 | // and that the error contains the specified substring. |