diff --git a/watch/filechanges.go b/watch/filechanges.go index fb0f9ef..3ce5dce 100644 --- a/watch/filechanges.go +++ b/watch/filechanges.go @@ -23,12 +23,6 @@ func (fc *FileChanges) NotifyDeleted() { sendOnlyIfEmpty(fc.Deleted) } -func (fc *FileChanges) Close() { - close(fc.Modified) - close(fc.Truncated) - close(fc.Deleted) -} - // sendOnlyIfEmpty sends on a bool channel only if the channel has no // backlog to be read by other goroutines. This concurrency pattern // can be used to notify other goroutines if and only if they are diff --git a/watch/inotify.go b/watch/inotify.go index c2f13dc..0b1b1fe 100644 --- a/watch/inotify.go +++ b/watch/inotify.go @@ -77,7 +77,6 @@ func (fw *InotifyFileWatcher) ChangeEvents(t *tomb.Tomb, fi os.FileInfo) *FileCh go func() { defer inotifyTracker.CloseWatcher(w) - defer changes.Close() for { prevSize := fw.Size diff --git a/watch/polling.go b/watch/polling.go index 10a17eb..de01c71 100644 --- a/watch/polling.go +++ b/watch/polling.go @@ -49,8 +49,6 @@ func (fw *PollingFileWatcher) ChangeEvents(t *tomb.Tomb, origFi os.FileInfo) *Fi fw.Size = origFi.Size() go func() { - defer changes.Close() - var retry int = 0 prevSize := fw.Size