(ctx context.Context)
| 60 | } |
| 61 | |
| 62 | func (fw *fsWatcher) Start(ctx context.Context) { |
| 63 | initEvents := fw.addRecursive(fw.root) |
| 64 | if len(initEvents) > 0 { |
| 65 | select { |
| 66 | case fw.events <- initEvents: |
| 67 | case <-ctx.Done(): |
| 68 | return |
| 69 | } |
| 70 | } |
| 71 | fw.logger.Debug(ctx, "fs watcher started", slog.F("root", fw.root)) |
| 72 | go fw.loop(ctx) |
| 73 | } |
| 74 | func (fw *fsWatcher) Events() <-chan []FSEvent { return fw.events } |
| 75 | func (fw *fsWatcher) Close() error { |
| 76 | fw.mu.Lock() |
nothing calls this directly
no test coverage detected