Close removes all watches and closes the events channel.
log.Fatal(err) } defer watcher.Close() done := make(chan bool)
// Close immediately; it won't even reach the first unix.Read. w.Close() // Wait for the close to complete.
// Wait until readEvents has reached unix.Read, and Close. <-time.After(50 * time.Millisecond) w.Close() // Wait for the close to complete.
Close is referenced in 33 repositoriesgithub.com/fsnotify/fsnotify
- 17 references in integration_test.go
- 10 references in inotify_test.go
- 1 reference in example_test.go
- 3 references in watcher_test.go
- 2 references in runner/utils.go