Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit39526e6

Browse files
committed
update noop impl.
1 parentaed7c30 commit39526e6

File tree

1 file changed

+3
-3
lines changed
  • agent/agentcontainers/watcher

1 file changed

+3
-3
lines changed

‎agent/agentcontainers/watcher/noop.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"sync"
66

77
"github.com/fsnotify/fsnotify"
8-
"golang.org/x/xerrors"
98
)
109

1110
// NewNoop creates a new watcher that does nothing.
@@ -27,20 +26,21 @@ func (*noopWatcher) Remove(string) error {
2726
returnnil
2827
}
2928

29+
// Next blocks until the context is canceled or the watcher is closed.
3030
func (n*noopWatcher)Next(ctx context.Context) (*fsnotify.Event,error) {
3131
select {
3232
case<-ctx.Done():
3333
returnnil,ctx.Err()
3434
case<-n.done:
35-
returnnil,xerrors.New("watcher closed")
35+
returnnil,ErrWatcherClosed
3636
}
3737
}
3838

3939
func (n*noopWatcher)Close()error {
4040
n.mu.Lock()
4141
defern.mu.Unlock()
4242
ifn.closed {
43-
returnnil
43+
returnErrWatcherClosed
4444
}
4545
n.closed=true
4646
close(n.done)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp