]> go.fuhry.dev Git - fsnotify.git/commitdiff
Windows: add missing defer to Watcher.WatchList (#447)
authorSojamann <robinbergewski@gmail.com>
Sun, 24 Apr 2022 03:11:44 +0000 (03:11 +0000)
committerGitHub <noreply@github.com>
Sun, 24 Apr 2022 03:11:44 +0000 (12:11 +0900)
windows.go

index ddc69ef879ba2aef78c642a879721d54cad22f4c..02ce7deb0bbf0a4f1cdc98f0ed7f652f457d8c84 100644 (file)
@@ -100,7 +100,7 @@ func (w *Watcher) Remove(name string) error {
 // WatchList returns the directories and files that are being monitered.
 func (w *Watcher) WatchList() []string {
        w.mu.Lock()
-       w.mu.Unlock()
+       defer w.mu.Unlock()
 
        entries := make([]string, 0, len(w.watches))
        for _, entry := range w.watches {