diff --git a/providers/file/file.go b/providers/file/file.go index e9f35469..dabcdf88 100644 --- a/providers/file/file.go +++ b/providers/file/file.go @@ -112,13 +112,13 @@ func (f *File) Watch(cb func(event interface{}, err error)) error { // Or has the real path of the file being watched changed? // // If either of the above are true, trigger the callback. - if (onWatchedFile && event.Op&(fsnotify.Write|fsnotify.Create) != 0) || + if (onWatchedFile && (event.Has(fsnotify.Create) || event.Has(fsnotify.Write))) || (curPath != "" && curPath != realPath) { realPath = curPath // Trigger event. cb(nil, nil) - } else if onWatchedFile && event.Op&fsnotify.Remove != 0 { + } else if onWatchedFile && event.Has(fsnotify.Remove) { cb(nil, fmt.Errorf("file %s was removed", event.Name)) break loop }