To decrease nesting go directive was removed.
This commit is contained in:
parent
51494e87be
commit
da001dbe39
@ -54,7 +54,6 @@ func (w *InotifyWatcher) AddWatch(path string, mask uint32) error {
|
|||||||
// WatchForMask checks for events specified in `mask` and sends them
|
// WatchForMask checks for events specified in `mask` and sends them
|
||||||
// to channel `fired`. See `man inotify` for events.
|
// to channel `fired`. See `man inotify` for events.
|
||||||
func (w *InotifyWatcher) WatchForMask(fired chan uint32, mask uint32) {
|
func (w *InotifyWatcher) WatchForMask(fired chan uint32, mask uint32) {
|
||||||
go func() {
|
|
||||||
for !w.closed {
|
for !w.closed {
|
||||||
buffer := make([]byte, syscall.SizeofInotifyEvent*inotifyCount)
|
buffer := make([]byte, syscall.SizeofInotifyEvent*inotifyCount)
|
||||||
n, err := syscall.Read(w.fd, buffer)
|
n, err := syscall.Read(w.fd, buffer)
|
||||||
@ -73,7 +72,6 @@ func (w *InotifyWatcher) WatchForMask(fired chan uint32, mask uint32) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close removes all watchers, closes inotify descriptor and stops all
|
// Close removes all watchers, closes inotify descriptor and stops all
|
||||||
|
Loading…
Reference in New Issue
Block a user