frostfs-node/cmd/neofs-node/worker.go
Alex Vanin 65a93af176 [#84] Fix loop variable capture issue in neofs-node workers
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-09 09:15:18 +03:00

20 lines
229 B
Go

package main
import (
"context"
)
type worker interface {
Run(context.Context)
}
func startWorkers(c *cfg) {
for _, wrk := range c.workers {
c.wg.Add(1)
go func(w worker) {
w.Run(c.ctx)
c.wg.Done()
}(wrk)
}
}