From: Sojamann Date: Sun, 24 Apr 2022 03:11:44 +0000 (+0000) Subject: Windows: add missing defer to Watcher.WatchList (#447) X-Git-Tag: v1.7.2~118 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=97640bb471030fdc797d207482a4faa002a35352;p=fsnotify.git Windows: add missing defer to Watcher.WatchList (#447) --- diff --git a/windows.go b/windows.go index ddc69ef..02ce7de 100644 --- a/windows.go +++ b/windows.go @@ -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 {