A lot of Watcher has now been rewritten and now contains better/cleaner code.
- Instead of adding and removing directories recursively by default or passing options to specify to watch non-recursively, there are now 2 cleaner methods for each,
- There’s also no longer the need to choose whether to ignore hidden files or not as an option, as there’s a new
- Rename and Move events now return the path (Event.Path) in the format of
oldPath -> newPath.
- Close method to stop the watcher, as well as clearing the watched file’s list.
- Closed channel to listen for when the watcher is closed, used to break out of the main polling goroutine loop, preventing any goroutine leaks.
- Added Move Event.
- Event filtering to specify what events to receive on the Event channel. For example, choosing only to receive Rename or Move events.