From 97640bb471030fdc797d207482a4faa002a35352 Mon Sep 17 00:00:00 2001 From: Sojamann Date: Sun, 24 Apr 2022 03:11:44 +0000 Subject: [PATCH] Windows: add missing defer to Watcher.WatchList (#447) --- windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows.go b/windows.go index ddc69ef8..02ce7deb 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 {