Skip to content

Commit

Permalink
introduce Op.Has
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Oct 29, 2022
1 parent 6ccd1cd commit 17af54a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ func (t *tail) runFile() {
for {
select {
case event := <-t.watcher.Events:
if (event.Op & fsnotify.Remove) != 0 {
if event.Op.Has(fsnotify.Remove) {
// the target file is removed, stop tailing.
return
}
if (event.Op & fsnotify.Rename) != 0 {
if event.Op.Has(fsnotify.Rename) {
// log rotation is detected.
if !renamed {
// start to watch creating new file.
Expand Down

0 comments on commit 17af54a

Please sign in to comment.