(root string)
| 72 | } |
| 73 | |
| 74 | func (w *Watcher) addRecursive(root string) error { |
| 75 | return filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error { |
| 76 | if err != nil { |
| 77 | return nil |
| 78 | } |
| 79 | if !d.IsDir() { |
| 80 | return nil |
| 81 | } |
| 82 | name := d.Name() |
| 83 | if name == ".git" || name == "node_modules" || name == "vendor" { |
| 84 | return filepath.SkipDir |
| 85 | } |
| 86 | return w.fsw.Add(path) |
| 87 | }) |
| 88 | } |
| 89 | |
| 90 | // shouldFire returns true for events we care about: writes/creates/removes on .go files. |
| 91 | // Newly created directories are added to the watch set as a side effect. |
no outgoing calls
no test coverage detected