fix staticcheck

This commit is contained in:
A.Unger
2021-01-25 15:53:13 +01:00
parent 49b19418d2
commit 70206b7c2f
3 changed files with 8 additions and 13 deletions

View File

@@ -2,12 +2,9 @@ package controller
// detach will try to restart processes on failures.
func detach(c *Controller) {
for {
select {
case proc := <-c.Terminated:
if err := c.Start(proc); err != nil {
c.log.Err(err)
}
for proc := range c.Terminated {
if err := c.Start(proc); err != nil {
c.log.Err(err)
}
}
}

View File

@@ -45,7 +45,7 @@ func (m *Map) Load(name string) int {
// LoadAll values from the underlying data structure.
func (m *Map) LoadAll() Entries {
e := make(map[string]int, 0)
e := make(map[string]int)
m.c.Range(func(k, v interface{}) bool {
ks, ok := k.(string)
if !ok {

View File

@@ -36,12 +36,10 @@ func (w *Watcher) Follow(pe process.ProcEntry, followerChan chan process.ProcEnt
}()
go func() {
select {
case status := <-state:
w.log.Info().Str("package", "watcher").Msgf("%v exited with: %v", pe.Extension, status)
if restart {
followerChan <- pe
}
status := <-state
w.log.Info().Str("package", "watcher").Msgf("%v exited with: %v", pe.Extension, status)
if restart {
followerChan <- pe
}
}()
}