all: imp code

This commit is contained in:
Eugene Burkov 2024-06-14 14:57:01 +03:00
parent e033558d70
commit c545152fa1
2 changed files with 10 additions and 5 deletions

View File

@ -161,7 +161,8 @@ func (hc *HostsContainer) handleEvents() {
defer close(hc.updates)
ok, eventsCh := true, hc.watcher.Events()
eventsCh := hc.watcher.Events()
ok := eventsCh != nil
for ok {
select {
case _, ok = <-eventsCh:

View File

@ -168,22 +168,26 @@ type EmptyFSWatcher struct{}
// type check
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) {
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) {
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) {
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) {
return nil
}