When the Result Pool is configured WithErrors results after fir error are clipped.
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]