]> go.fuhry.dev Git - fsnotify.git/commitdiff
Document that Watcher.Remove returns nil if the Watcher is closed
authorMartin Tournoij <martin@arp242.net>
Wed, 16 Nov 2022 04:17:23 +0000 (05:17 +0100)
committerMartin Tournoij <martin@arp242.net>
Wed, 16 Nov 2022 04:18:01 +0000 (05:18 +0100)
This was already tested in TestClose/error_after_closed; just wasn't
documented.

backend_fen.go
backend_inotify.go
backend_kqueue.go
backend_other.go
backend_windows.go
mkdoc.zsh

index 1f4dcf778d6b0dff6bbb1157af786fcd7ca7d623..255e53341f05be3268ef3ea61fa8648fe82b5eba 100644 (file)
@@ -270,6 +270,8 @@ func (w *Watcher) AddWith(name string, opts ...addOpt) error {
 // /tmp/dir and /tmp/dir/subdir then you will need to remove both.
 //
 // Removing a path that has not yet been added returns [ErrNonExistentWatch].
+//
+// Returns nil if [Watcher.Close] was called.
 func (w *Watcher) Remove(name string) error {
        if w.isClosed() {
                return nil
index e0f9f28c8868052c9ed93bfd95663fe7abdc00f5..2f47f4da157a08b1e0c5569d6d3c13b216ac332a 100644 (file)
@@ -285,6 +285,8 @@ func (w *Watcher) AddWith(name string, opts ...addOpt) error {
 // /tmp/dir and /tmp/dir/subdir then you will need to remove both.
 //
 // Removing a path that has not yet been added returns [ErrNonExistentWatch].
+//
+// Returns nil if [Watcher.Close] was called.
 func (w *Watcher) Remove(name string) error {
        if w.isClosed() {
                return nil
index e48225b276a4dfb3e87c529caea19ab644969f87..b83e7798571476222b74bd2b632765bce35cc2b4 100644 (file)
@@ -292,6 +292,8 @@ func (w *Watcher) AddWith(name string, opts ...addOpt) error {
 // /tmp/dir and /tmp/dir/subdir then you will need to remove both.
 //
 // Removing a path that has not yet been added returns [ErrNonExistentWatch].
+//
+// Returns nil if [Watcher.Close] was called.
 func (w *Watcher) Remove(name string) error {
        return w.remove(name, true)
 }
index b62717072d64b38d7bcb6e92ef7247d6b234efb3..bbf85a2f7497645d1933c9d2deec51099a964590 100644 (file)
@@ -166,4 +166,6 @@ func (w *Watcher) AddWith(name string, opts ...addOpt) error { return nil }
 // /tmp/dir and /tmp/dir/subdir then you will need to remove both.
 //
 // Removing a path that has not yet been added returns [ErrNonExistentWatch].
+//
+// Returns nil if [Watcher.Close] was called.
 func (w *Watcher) Remove(name string) error { return nil }
index 86a320a0402eaf6f6f572df92c1afc7a7fda7929..2dd9aff6415585ff7c3f10576c948d4753d76ec0 100644 (file)
@@ -262,6 +262,8 @@ func (w *Watcher) AddWith(name string, opts ...addOpt) error {
 // /tmp/dir and /tmp/dir/subdir then you will need to remove both.
 //
 // Removing a path that has not yet been added returns [ErrNonExistentWatch].
+//
+// Returns nil if [Watcher.Close] was called.
 func (w *Watcher) Remove(name string) error {
        if w.isClosed() {
                return nil
index 02216e74171f4b29384560e9fa8356b6150e9b2c..228061e142ec8247e47566a5b55aa297e7901a84 100755 (executable)
--- a/mkdoc.zsh
+++ b/mkdoc.zsh
@@ -120,6 +120,8 @@ remove=$(<<EOF
 // /tmp/dir and /tmp/dir/subdir then you will need to remove both.
 //
 // Removing a path that has not yet been added returns [ErrNonExistentWatch].
+//
+// Returns nil if [Watcher.Close] was called.
 EOF
 )