Stop signals the watcher to stop.
()
| 87 | |
| 88 | // Stop signals the watcher to stop. |
| 89 | func (w *Watcher) Stop() { |
| 90 | w.mu.Lock() |
| 91 | defer w.mu.Unlock() |
| 92 | select { |
| 93 | case <-w.done: |
| 94 | // already closed |
| 95 | default: |
| 96 | close(w.done) |
| 97 | } |
| 98 | if w.watcher != nil { |
| 99 | w.watcher.Close() |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | func (w *Watcher) addRecursive(fsw *fsnotify.Watcher, root string) error { |
| 104 | return filepath.WalkDir(root, func(path string, d os.DirEntry, err error) error { |
no outgoing calls