diff --git a/README.md b/README.md index e4ec2ba..f01991a 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ func main() { if event.Name == inotify.EventCreate { err = watcher.AddWatch(event.Path) 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) diff --git a/example/main.go b/example/main.go index 6780a99..12eec01 100644 --- a/example/main.go +++ b/example/main.go @@ -43,7 +43,7 @@ func main() { if event.Name == inotify.EventCreate { err = watcher.AddWatch(event.Path) 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)