Versions in this module Expand all Collapse all v0 v0.1.2 Nov 4, 2026 v0.1.0 Nov 3, 2026 Changes in this version + var ErrInvalidContext = errors.New("conc: context 不能为空") + var ErrInvalidLimit = errors.New("conc: 并发限额必须大于零") + var ErrInvalidTimeout = errors.New("conc: 超时时间必须大于零") + var ErrNilTask = errors.New("conc: 任务函数不能为空") + var ErrTimeoutWithLimit = errors.New("conc: WithTimeout 与 WithLimit 不能同时使用") + type Option func(*options) + func WithCancelOnError() Option + func WithLimit(n int) Option + func WithTimeout(d time.Duration) Option + type PanicError struct + Stack []byte + TaskName string + Value any + func (e *PanicError) Error() string + type Report struct + Duration time.Duration + Results map[string]Result + func RunNamed(ctx context.Context, tasks map[string]Task, opts ...Option) (report Report, err error) + type Result struct + Duration time.Duration + Err error + Started bool + TimedOut bool + Value any + type Task func(context.Context) (any, error)