all: imp code
This commit is contained in:
parent
e033558d70
commit
c545152fa1
|
@ -161,7 +161,8 @@ func (hc *HostsContainer) handleEvents() {
|
||||||
|
|
||||||
defer close(hc.updates)
|
defer close(hc.updates)
|
||||||
|
|
||||||
ok, eventsCh := true, hc.watcher.Events()
|
eventsCh := hc.watcher.Events()
|
||||||
|
ok := eventsCh != nil
|
||||||
for ok {
|
for ok {
|
||||||
select {
|
select {
|
||||||
case _, ok = <-eventsCh:
|
case _, ok = <-eventsCh:
|
||||||
|
|
|
@ -168,22 +168,26 @@ type EmptyFSWatcher struct{}
|
||||||
// type check
|
// type check
|
||||||
var _ FSWatcher = EmptyFSWatcher{}
|
var _ FSWatcher = EmptyFSWatcher{}
|
||||||
|
|
||||||
// Start implements the [FSWatcher] interface for EmptyFSWatcher.
|
// Start implements the [FSWatcher] interface for EmptyFSWatcher. It always
|
||||||
|
// returns nil error.
|
||||||
func (EmptyFSWatcher) Start() (err error) {
|
func (EmptyFSWatcher) Start() (err error) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close implements the [FSWatcher] interface for EmptyFSWatcher.
|
// Close implements the [FSWatcher] interface for EmptyFSWatcher. It always
|
||||||
|
// returns nil error.
|
||||||
func (EmptyFSWatcher) Close() (err error) {
|
func (EmptyFSWatcher) Close() (err error) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Events implements the [FSWatcher] interface for EmptyFSWatcher.
|
// Events implements the [FSWatcher] interface for EmptyFSWatcher. It always
|
||||||
|
// returns nil channel.
|
||||||
func (EmptyFSWatcher) Events() (e <-chan event) {
|
func (EmptyFSWatcher) Events() (e <-chan event) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add implements the [FSWatcher] interface for EmptyFSWatcher.
|
// Add implements the [FSWatcher] interface for EmptyFSWatcher. It always
|
||||||
|
// returns nil error.
|
||||||
func (EmptyFSWatcher) Add(_ string) (err error) {
|
func (EmptyFSWatcher) Add(_ string) (err error) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue