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.
(err error, target interface{}, msg string, args ...interface{})
| 249 | // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. |
| 250 | // This is a wrapper for errors.As. |
| 251 | func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) { |
| 252 | if h, ok := a.t.(tHelper); ok { |
| 253 | h.Helper() |
| 254 | } |
| 255 | ErrorAsf(a.t, err, target, msg, args...) |
| 256 | } |
| 257 | |
| 258 | // ErrorContains asserts that a function returned an error (i.e. not `nil`) |
| 259 | // and that the error contains the specified substring. |