diff --git a/watch/inotify.go b/watch/inotify.go index 0676ac3..258e3ef 100644 --- a/watch/inotify.go +++ b/watch/inotify.go @@ -77,7 +77,7 @@ func (fw *InotifyFileWatcher) ChangeEvents(t *tomb.Tomb, fi os.FileInfo) *FileCh for { prevSize := fw.Size - var evt *fsnotify.Event + var evt fsnotify.Event var ok bool select { diff --git a/watch/inotify_tracker.go b/watch/inotify_tracker.go index d47bc5d..07e7d7a 100644 --- a/watch/inotify_tracker.go +++ b/watch/inotify_tracker.go @@ -16,7 +16,7 @@ import ( type InotifyTracker struct { mux sync.Mutex watcher *fsnotify.Watcher - chans map[string]chan *fsnotify.Event + chans map[string]chan fsnotify.Event done map[string]chan bool watch chan *watchInfo remove chan string @@ -36,7 +36,7 @@ var ( goRun = func() { shared = &InotifyTracker{ mux: sync.Mutex{}, - chans: make(map[string]chan *fsnotify.Event), + chans: make(map[string]chan fsnotify.Event), done: make(map[string]chan bool), watch: make(chan *watchInfo), remove: make(chan string), @@ -78,7 +78,7 @@ func RemoveWatch(fname string) { // Events returns a channel to which FileEvents corresponding to the input filename // will be sent. This channel will be closed when removeWatch is called on this // filename. -func Events(fname string) chan *fsnotify.Event { +func Events(fname string) chan fsnotify.Event { shared.mux.Lock() defer shared.mux.Unlock() @@ -97,7 +97,7 @@ func (shared *InotifyTracker) addWatch(fname string) error { defer shared.mux.Unlock() if shared.chans[fname] == nil { - shared.chans[fname] = make(chan *fsnotify.Event) + shared.chans[fname] = make(chan fsnotify.Event) shared.done[fname] = make(chan bool) } return shared.watcher.Add(fname) @@ -118,7 +118,7 @@ func (shared *InotifyTracker) removeWatch(fname string) { } // sendEvent sends the input event to the appropriate Tail. -func (shared *InotifyTracker) sendEvent(event *fsnotify.Event) { +func (shared *InotifyTracker) sendEvent(event fsnotify.Event) { shared.mux.Lock() ch := shared.chans[event.Name] done := shared.done[event.Name] @@ -153,7 +153,7 @@ func (shared *InotifyTracker) run() { if !open { return } - shared.sendEvent(&event) + shared.sendEvent(event) case err, open := <-shared.watcher.Errors: if !open {