@@ -20,8 +20,7 @@ import (
2020// The parameter `path` can be either a file or a directory path.
2121// The optional parameter `recursive` specifies whether monitoring the `path` recursively,
2222// which is true in default.
23- func (w * Watcher ) Add (
24- path string , callbackFunc func (event * Event ), option ... WatchOption ,
23+ func (w * Watcher ) Add (path string , callbackFunc func (event * Event ), option ... WatchOption ,
2524) (callback * Callback , err error ) {
2625 return w .AddOnce ("" , path , callbackFunc , option ... )
2726}
@@ -35,8 +34,7 @@ func (w *Watcher) Add(
3534// The parameter `path` can be either a file or a directory path.
3635// The optional parameter `recursive` specifies whether monitoring the `path` recursively,
3736// which is true in default.
38- func (w * Watcher ) AddOnce (
39- name , path string , callbackFunc func (event * Event ), option ... WatchOption ,
37+ func (w * Watcher ) AddOnce (name , path string , callbackFunc func (event * Event ), option ... WatchOption ,
4038) (callback * Callback , err error ) {
4139 var watchOption = w .getWatchOption (option ... )
4240 w .nameSet .AddIfNotExistFuncLock (name , func () bool {
@@ -89,8 +87,7 @@ func (w *Watcher) getWatchOption(option ...WatchOption) WatchOption {
8987
9088// addWithCallbackFunc adds the path to underlying monitor, creates and returns a callback object.
9189// Very note that if it calls multiple times with the same `path`, the latest one will overwrite the previous one.
92- func (w * Watcher ) addWithCallbackFunc (
93- name , path string , callbackFunc func (event * Event ), option ... WatchOption ,
90+ func (w * Watcher ) addWithCallbackFunc (name , path string , callbackFunc func (event * Event ), option ... WatchOption ,
9491) (callback * Callback , err error ) {
9592 var watchOption = w .getWatchOption (option ... )
9693 // Check and convert the given path to absolute path.
0 commit comments