Skip to content

Commit

Permalink
code clean for fsnotify (#9571)
Browse files Browse the repository at this point in the history
Signed-off-by: yanggang <[email protected]>
  • Loading branch information
杨刚 (成都) authored Feb 16, 2023
1 parent 57398de commit 080c905
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/util/file/file_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ func (f *OSFileWatcher) watch() error {
for {
select {
case event := <-watcher.Events:
if event.Op&fsnotify.Create == fsnotify.Create ||
event.Op&fsnotify.Write == fsnotify.Write {
if event.Has(fsnotify.Create) ||
event.Has(fsnotify.Write) {
if finfo, err := os.Lstat(event.Name); err != nil {
log.Printf("can not lstat file: %v\n", err)
} else if finfo.Mode()&os.ModeSymlink != 0 {
Expand Down

0 comments on commit 080c905

Please sign in to comment.