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{})
| 138 | // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. |
| 139 | // This is a wrapper for errors.As. |
| 140 | func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) bool { |
| 141 | if h, ok := t.(tHelper); ok { |
| 142 | h.Helper() |
| 143 | } |
| 144 | return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...) |
| 145 | } |
| 146 | |
| 147 | // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) |
| 148 | // and that the error contains the specified substring. |