vendor/github.com/fsnotify/fsnotify/kqueue.go
changeset 260 445e01aede7e
parent 242 2a9ec03fe5a1
--- a/vendor/github.com/fsnotify/fsnotify/kqueue.go	Tue Aug 23 22:33:28 2022 +0200
+++ b/vendor/github.com/fsnotify/fsnotify/kqueue.go	Tue Aug 23 22:39:43 2022 +0200
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build freebsd || openbsd || netbsd || dragonfly || darwin
 // +build freebsd openbsd netbsd dragonfly darwin
 
 package fsnotify
@@ -147,6 +148,19 @@
 	return nil
 }
 
+// WatchList returns the directories and files that are being monitered.
+func (w *Watcher) WatchList() []string {
+	w.mu.Lock()
+	defer w.mu.Unlock()
+
+	entries := make([]string, 0, len(w.watches))
+	for pathname := range w.watches {
+		entries = append(entries, pathname)
+	}
+
+	return entries
+}
+
 // Watch all events (except NOTE_EXTEND, NOTE_LINK, NOTE_REVOKE)
 const noteAllEvents = unix.NOTE_DELETE | unix.NOTE_WRITE | unix.NOTE_ATTRIB | unix.NOTE_RENAME