]> go.fuhry.dev Git - fsnotify.git/commitdiff
Clarify doc comment on WatchList() (#499)
authorMartin Tournoij <martin@arp242.net>
Wed, 10 Aug 2022 17:03:32 +0000 (19:03 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Aug 2022 17:03:32 +0000 (19:03 +0200)
backend_inotify.go
backend_kqueue.go
backend_windows.go
mkdoc.zsh

index 74441914168bcadd7663aa1058996981ae6f28c1..855e65406d424a1ab436c14b72a0355f64c2b81a 100644 (file)
@@ -312,7 +312,7 @@ func (w *Watcher) Remove(name string) error {
        return nil
 }
 
-// WatchList returns the directories and files that are being monitered.
+// WatchList returns all paths added with Add() (and are not yet removed).
 func (w *Watcher) WatchList() []string {
        w.mu.Lock()
        defer w.mu.Unlock()
index feb570506ad0818d6e4bb7cd3b1e45539d54ee0e..409c645d9c8a3542b4a64d7b62d13a5d8da680aa 100644 (file)
@@ -332,7 +332,7 @@ func (w *Watcher) Remove(name string) error {
        return nil
 }
 
-// WatchList returns the directories and files that are being monitered.
+// WatchList returns all paths added with Add() (and are not yet removed).
 func (w *Watcher) WatchList() []string {
        w.mu.Lock()
        defer w.mu.Unlock()
index c52272b2ae8af227b5716e134c010585932e5c91..a2540539e04c50b3116794b380848cd7a7079324 100644 (file)
@@ -252,7 +252,7 @@ func (w *Watcher) Remove(name string) error {
        return <-in.reply
 }
 
-// WatchList returns the directories and files that are being monitered.
+// WatchList returns all paths added with Add() (and are not yet removed).
 func (w *Watcher) WatchList() []string {
        w.mu.Lock()
        defer w.mu.Unlock()
index fd44b253e9b086533c4b4b5e0cadb2f4da618774..b6dff6e1406c5b35a97e4cc210482424041f8438 100755 (executable)
--- a/mkdoc.zsh
+++ b/mkdoc.zsh
@@ -119,6 +119,11 @@ close=$(<<EOF
 EOF
 )
 
+watchlist=$(<<EOF
+// WatchList returns all paths added with Add() (and are not yet removed).
+EOF
+)
+
 events=$(<<EOF
        // Events sends the filesystem change events.
        //
@@ -194,5 +199,6 @@ set-cmt '^func NewWatcher('                 $new
 set-cmt '^func (w \*Watcher) Add('          $add
 set-cmt '^func (w \*Watcher) Remove('       $remove
 set-cmt '^func (w \*Watcher) Close('        $close
+set-cmt '^func (w \*Watcher) WatchList('    $watchlist
 set-cmt '^[[:space:]]*Events *chan Event$'  $events
 set-cmt '^[[:space:]]*Errors *chan error$'  $errors