From: Nathan Youngman Date: Sat, 16 Aug 2014 05:12:21 +0000 (-0600) Subject: Remove AddWatch on Windows, use Add. X-Git-Tag: v1.7.2~283 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=1a9d88000dce27faf39fcdeeb2b748b647e29aef;p=fsnotify.git Remove AddWatch on Windows, use Add. I really thought I did this before. :disappointed: --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e78e16..79c78aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v1.0.0 / 2014-08-15 + +* [API] Remove AddWatch on Windows, use Add. + ## v0.14.3 / 2014-08-15 * Improve documentation for exported identifiers. [#30](https://github.com/go-fsnotify/fsnotify/issues/30) @@ -24,7 +28,6 @@ ## v0.13.0 / 2014-06-21 * Events channel of type Event rather than *Event. -* [API] Remove AddWatch on Windows, use Add. * [internal] use syscall constants directly for inotify and kqueue. * [internal] kqueue: rename events to kevents and fileEvent to event. diff --git a/fsnotify_windows.go b/fsnotify_windows.go index 31c13ba..520f32e 100644 --- a/fsnotify_windows.go +++ b/fsnotify_windows.go @@ -140,15 +140,15 @@ func (w *Watcher) Close() error { return <-ch } -// AddWatch adds path to the watched file set. -func (w *Watcher) AddWatch(name string, flags uint32) error { +// Add starts watching the named file or directory (non-recursively). +func (w *Watcher) Add(name string) error { if w.isClosed { return errors.New("watcher already closed") } in := &input{ op: opAddWatch, path: filepath.Clean(name), - flags: flags, + flags: sys_FS_ALL_EVENTS, reply: make(chan error), } w.input <- in @@ -158,11 +158,6 @@ func (w *Watcher) AddWatch(name string, flags uint32) error { return <-in.reply } -// Add starts watching the named file or directory (non-recursively). -func (w *Watcher) Add(name string) error { - return w.AddWatch(name, sys_FS_ALL_EVENTS) -} - // Remove stops watching the the named file or directory (non-recursively). func (w *Watcher) Remove(name string) error { in := &input{