{"action":"created","issue":{"url":"https://api.github.com/repos/go-fsnotify/fsnotify/issues/68","labels_url":"https://api.github.com/repos/go-fsnotify/fsnotify/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/go-fsnotify/fsnotify/issues/68/comments","events_url":"https://api.github.com/repos/go-fsnotify/fsnotify/issues/68/events","html_url":"https://github.com/go-fsnotify/fsnotify/issues/68","id":57406250,"number":68,"title":"watcher.Errors channel spamming <nil> events (kqueue, OSX)","user":{"login":"pbdeuchler","id":712346,"avatar_url":"https://avatars.githubusercontent.com/u/712346?v=3","gravatar_id":"","url":"https://api.github.com/users/pbdeuchler","html_url":"https://github.com/pbdeuchler","followers_url":"https://api.github.com/users/pbdeuchler/followers","following_url":"https://api.github.com/users/pbdeuchler/following{/other_user}","gists_url":"https://api.github.com/users/pbdeuchler/gists{/gist_id}","starred_url":"https://api.github.com/users/pbdeuchler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbdeuchler/subscriptions","organizations_url":"https://api.github.com/users/pbdeuchler/orgs","repos_url":"https://api.github.com/users/pbdeuchler/repos","events_url":"https://api.github.com/users/pbdeuchler/events{/privacy}","received_events_url":"https://api.github.com/users/pbdeuchler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/go-fsnotify/fsnotify/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/go-fsnotify/fsnotify/labels/OS%20X%20(kqueue)","name":"OS X (kqueue)","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-12T01:50:26Z","updated_at":"2015-02-12T07:54:25Z","closed_at":null,"body":"Howdy,\r\n\r\nI'm implementing a very simple file watcher, almost identical to the example given in the repo. However immediately upon running I get spammed with incessant `<nil>` errors from the watcher.Errors channel. \r\n\r\nBeyond the root cause it's puzzling to me that this could happen, since I checked the source and you guys do the standard `if err != nil` check for any place you send an error over the wire\r\n\r\nCode:\r\n```go\r\nfunc (dr *DiskRecieve) Run() error {\r\n\twatcher, err := fsnotify.NewWatcher()\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\tdefer watcher.Close()\r\n\tfmt.Printf(\"monitor dir: %s \\n\", dr.monitorDir)\r\n\tgo func() {\r\n\t\tfor {\r\n\t\t\tselect {\r\n\t\t\tcase event := <-watcher.Events:\r\n\t\t\t\tif event.Op&fsnotify.Write == fsnotify.Write { // We only want write events, correct?\r\n\t\t\t\t\tlog.Println(\"new write file event:\", event.Name)\r\n\t\t\t\t\tdr.wd.Acquire()\r\n\t\t\t\t\tgo dr.processEvent(event)\r\n\t\t\t\t}\r\n\t\t\tcase err := <-watcher.Errors:\r\n\t\t\t\tlog.Println(\"file watcher error:\", err)\r\n\t\t\t}\r\n\t\t}\r\n\t}()\r\n\r\n\terr = watcher.Add(dr.monitorDir)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\treturn err\r\n}\r\n```\r\n\r\nOutput:\r\n```bash\r\n2015/02/11 18:37:50 file watcher error: <nil>\r\n2015/02/11 18:37:50 file watcher error: <nil>\r\n2015/02/11 18:37:50 file watcher error: <nil>\r\n2015/02/11 18:37:50 file watcher error: <nil>\r\n2015/02/11 18:37:50 file watcher error: <nil>\r\n2015/02/11 18:37:50 file watcher error: <nil>\r\n2015/02/11 18:37:50 file watcher error: <nil>\r\n2015/02/11 18:37:50 file watcher error: <nil>\r\n2015/02/11 18:37:50 file watcher error: <nil>\r\n2015/02/11 18:37:50 file watcher error: <nil>\r\n...\r\n```"},"comment":{"url":"https://api.github.com/repos/go-fsnotify/fsnotify/issues/comments/74031016","html_url":"https://github.com/go-fsnotify/fsnotify/issues/68#issuecomment-74031016","issue_url":"https://api.github.com/repos/go-fsnotify/fsnotify/issues/68","id":74031016,"user":{"login":"PieterD","id":821733,"avatar_url":"https://avatars.githubusercontent.com/u/821733?v=3","gravatar_id":"","url":"https://api.github.com/users/PieterD","html_url":"https://github.com/PieterD","followers_url":"https://api.github.com/users/PieterD/followers","following_url":"https://api.github.com/users/PieterD/following{/other_user}","gists_url":"https://api.github.com/users/PieterD/gists{/gist_id}","starred_url":"https://api.github.com/users/PieterD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PieterD/subscriptions","organizations_url":"https://api.github.com/users/PieterD/orgs","repos_url":"https://api.github.com/users/PieterD/repos","events_url":"https://api.github.com/users/PieterD/events{/privacy}","received_events_url":"https://api.github.com/users/PieterD/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T07:54:24Z","updated_at":"2015-02-12T07:54:24Z","body":"That would happen when the goroutine dies. Sounds bad."}}