Merge pull request #29694 from lixiaobing10051267/masterFileNodify2

It is errNoSuchWatch not errNoSuchPoller in filenotify/poller.go
This commit is contained in:
Alexander Morozov 2016-12-27 09:04:34 -08:00 committed by GitHub
commit e3f61bd254
2 changed files with 3 additions and 3 deletions

View file

@ -15,8 +15,8 @@ import (
var ( var (
// errPollerClosed is returned when the poller is closed // errPollerClosed is returned when the poller is closed
errPollerClosed = errors.New("poller is closed") errPollerClosed = errors.New("poller is closed")
// errNoSuchPoller is returned when trying to remove a watch that doesn't exist // errNoSuchWatch is returned when trying to remove a watch that doesn't exist
errNoSuchWatch = errors.New("poller does not exist") errNoSuchWatch = errors.New("watch does not exist")
) )
// watchWaitTime is the time to wait between file poll loops // watchWaitTime is the time to wait between file poll loops

View file

@ -108,7 +108,7 @@ func assertEvent(w FileWatcher, eType fsnotify.Op) error {
select { select {
case e := <-w.Events(): case e := <-w.Events():
if e.Op != eType { if e.Op != eType {
err = fmt.Errorf("got wrong event type, expected %q: %v", eType, e) err = fmt.Errorf("got wrong event type, expected %q: %v", eType, e.Op)
} }
case e := <-w.Errors(): case e := <-w.Errors():
err = fmt.Errorf("got unexpected error waiting for events %v: %v", eType, e) err = fmt.Errorf("got unexpected error waiting for events %v: %v", eType, e)