()
| 100 | } |
| 101 | |
| 102 | func (w *Watcher) Stop() error { |
| 103 | mx.Lock() |
| 104 | defer mx.Unlock() |
| 105 | if w.stopFn == nil { |
| 106 | return nil |
| 107 | } |
| 108 | w.stopFn() |
| 109 | w.stopFn = nil |
| 110 | err := <-w.errCh |
| 111 | return err |
| 112 | } |
| 113 | |
| 114 | // getSyncImplementation returns an appropriate sync implementation for the |
| 115 | // project. |