Before invokes the provided function but does not return an error.
(cb func())
| 44 | |
| 45 | // Before invokes the provided function but does not return an error. |
| 46 | func (f *Fault) Before(cb func()) *Fault { |
| 47 | f.mu.Lock() |
| 48 | f.callback = cb |
| 49 | f.mu.Unlock() |
| 50 | |
| 51 | return f |
| 52 | } |
| 53 | |
| 54 | // Repeat causes the fault to repeat N times. |
| 55 | func (f *Fault) Repeat(n int) *Fault { |