Skip to content

Commit

Permalink
fix: apply suggestion
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Jul 9, 2020
1 parent 5962d6b commit 2e950df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/file/watch/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2e950df

Please sign in to comment.