()
| 56 | } |
| 57 | |
| 58 | func (w *Watchdog) Close() error { |
| 59 | w.cancel() |
| 60 | w.wg.Wait() |
| 61 | return nil |
| 62 | } |
| 63 | |
| 64 | // Timeout returns a channel that is closed if the watchdog times out. Note that the Timeout() chan |
| 65 | // will NOT be closed if the Watchdog is Close'd or its context expires, so it is important to read |