From 2e950dfef54beba22be73b7eee79cbd0b90637d7 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Thu, 9 Jul 2020 17:45:35 +0900 Subject: [PATCH] fix: apply suggestion Signed-off-by: hlts2 --- internal/file/watch/watch.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/file/watch/watch.go b/internal/file/watch/watch.go index b05a23c0054..3fd355dbc0e 100644 --- a/internal/file/watch/watch.go +++ b/internal/file/watch/watch.go @@ -71,12 +71,12 @@ func (w *watch) init() (*watch, error) { return nil, err } w.mu.RLock() - dirs := make(map[string]struct{}, len(w.dirs)) - for name, val := range w.dirs { - dirs[name] = val + dirs := make([]string, 0, len(w.dirs)) + for d := range w.dirs { + dirs = append(dirs, d) } w.mu.RUnlock() - for dir := range dirs { + for _, dir := range dirs { log.Debug("Adding watcher target: ", dir) err = watcher.Add(dir)