Results clipped after first error with `.WithErrors()`
Author: zoidoCreated Feb 6, 2026Updated Aug 21, 2026
When the Result Pool is configured WithErrors results after fir error are clipped.
- Affected version: trunk.
- 0.3.0 does not have this problem.
- Introduced in #126
Minimal Example
package main
import (
"errors"
"fmt"
"github.com/sourcegraph/conc/pool"
)
func main() {
p := pool.NewWithResults[int]().WithErrors()
p.Go(func() (int, error) { return 1, nil })
p.Go(func() (int, error) { return 2, errors.New("an error") })
p.Go(func() (int, error) { return 3, nil })
got, _ := p.Wait()
fmt.Println(got) // Outputs [1]
}
Expected output: [1 3]
Source: sourcegraph/conc