Return if executors length is zero in ParallelExecutor

This commit is contained in:
Lunny Xiao
2026-05-12 21:07:59 -07:00
parent 763b38ece3
commit 674f362c2a

View File

@@ -98,6 +98,10 @@ func NewErrorExecutor(err error) Executor {
// NewParallelExecutor creates a new executor from a parallel of other executors
func NewParallelExecutor(parallel int, executors ...Executor) Executor {
return func(ctx context.Context) error {
if len(executors) == 0 {
return nil
}
work := make(chan Executor, len(executors))
errs := make(chan error, len(executors))