diff options
author | Valery Piashchynski <[email protected]> | 2020-11-13 17:43:20 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-11-13 17:43:20 +0300 |
commit | 9fd0b28d3a6a60b5e08af03bd86bcef042152e1c (patch) | |
tree | 2e925c736eb8cf3b27995db0882d06557432925f /static_pool.go | |
parent | 99b6012400ab407cfcb04aab833640af565d550d (diff) |
golangci linters warnings fix
Diffstat (limited to 'static_pool.go')
-rwxr-xr-x | static_pool.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/static_pool.go b/static_pool.go index 2d23f518..0e5ee050 100755 --- a/static_pool.go +++ b/static_pool.go @@ -70,12 +70,7 @@ func NewPool(ctx context.Context, cmd func() *exec.Cmd, factory Factory, cfg Con before: make([]Before, 0, 0), } - var err error - p.allocator, err = newPoolAllocator(factory, cmd) - if err != nil { - return nil, errors.E(op, err) - } - + p.allocator = newPoolAllocator(factory, cmd) p.ww = newWorkerWatcher(p.allocator, p.cfg.NumWorkers, p.events) workers, err := p.allocateWorkers(ctx, p.cfg.NumWorkers) @@ -279,7 +274,7 @@ func defaultErrEncoder(sp *StaticPool) ErrorEncoder { } } -func newPoolAllocator(factory Factory, cmd func() *exec.Cmd) (Allocator, error) { +func newPoolAllocator(factory Factory, cmd func() *exec.Cmd) Allocator { return func() (WorkerBase, error) { w, err := factory.SpawnWorkerWithContext(bCtx, cmd()) if err != nil { @@ -291,7 +286,7 @@ func newPoolAllocator(factory Factory, cmd func() *exec.Cmd) (Allocator, error) return nil, err } return sw, nil - }, nil + } } func (sp *StaticPool) execDebug(p Payload) (Payload, error) { |