fixed: error

This commit is contained in:
lovezsh 2020-05-26 10:48:34 +08:00
parent 2a86751b60
commit 855b7b495c
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ func main() {
if event.Name == inotify.EventCreate { if event.Name == inotify.EventCreate {
err = watcher.AddWatch(event.Path) err = watcher.AddWatch(event.Path)
if err != nil { if err != nil {
log.Fatalf("failed to add watch %s, error: %v\n", os.Args[1], err) log.Fatalf("failed to add watch %s, error: %v\n", event.Path, err)
} }
} }
fmt.Println("Directory:", event.Path, "event:", event.Name) fmt.Println("Directory:", event.Path, "event:", event.Name)

View File

@ -43,7 +43,7 @@ func main() {
if event.Name == inotify.EventCreate { if event.Name == inotify.EventCreate {
err = watcher.AddWatch(event.Path) err = watcher.AddWatch(event.Path)
if err != nil { if err != nil {
log.Fatalf("failed to add watch %s, error: %v\n", os.Args[1], err) log.Fatalf("failed to add watch %s, error: %v\n", event.Path, err)
} }
} }
fmt.Println("Directory:", event.Path, "event:", event.Name) fmt.Println("Directory:", event.Path, "event:", event.Name)