Skip to content

Commit dcd576c

Browse files
fix: unreachable code in addWatch - record source before return
1 parent e2f2d71 commit dcd576c

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

internal/provider/watcher_unix.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,13 @@ func (wp *WatcherProvider) addWatch(path string) error {
9494
return err
9595
}
9696

97+
wp.sources[path] = true
98+
wp.includeSources[path] = true
99+
97100
if fileInfo.IsDir() {
98101
return wp.watcher.AddRecursive(path)
99102
}
100103
return wp.watcher.Add(path)
101-
102-
wp.sources[path] = true
103-
wp.includeSources[path] = true
104-
105-
return nil
106104
}
107105

108106
// watchLoop обрабатывает события от watcher.

0 commit comments

Comments
 (0)