summaryrefslogtreecommitdiff
path: root/static_pool.go
diff options
context:
space:
mode:
Diffstat (limited to 'static_pool.go')
-rwxr-xr-xstatic_pool.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/static_pool.go b/static_pool.go
index 4e49b212..d5511018 100755
--- a/static_pool.go
+++ b/static_pool.go
@@ -54,6 +54,9 @@ type StaticPool struct {
// NewPool creates new worker pool and task multiplexer. StaticPool will initiate with one worker.
func NewPool(ctx context.Context, cmd func() *exec.Cmd, factory Factory, cfg PoolConfig, options ...PoolOptions) (Pool, error) {
const op = errors.Op("NewPool")
+ if factory == nil {
+ return nil, errors.E(op, errors.Str("no factory initialized"))
+ }
cfg.InitDefaults()
if cfg.Debug {