ErrorInstead causes the fault to return the provided error instead of calling the method.
(err error)
| 26 | |
| 27 | // ErrorInstead causes the fault to return the provided error instead of calling the method. |
| 28 | func (f *Fault) ErrorInstead(err error) *Fault { |
| 29 | f.mu.Lock() |
| 30 | f.errCallback = func() error { return err } |
| 31 | f.mu.Unlock() |
| 32 | |
| 33 | return f |
| 34 | } |
| 35 | |
| 36 | // ErrorCallbackInstead invokes the provided function to return the error instead of calling the method. |
| 37 | func (f *Fault) ErrorCallbackInstead(cb func() error) *Fault { |