Skip to content

Commit

Permalink
add WithoutCancel()
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Nov 12, 2024
1 parent 8cd9a46 commit f5509a1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions errgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ func WithCancel(ctx context.Context) *Group {
return &Group{ctx: ctx, cancel: cancel}
}

// WithoutCancel create a new Group and an associated Context derived from ctx.
// given function from Go will receive context derived from this ctx,
// The derived Context is not canceled the first time a function passed to Go
// returns a non-nil error or the first time Wait returns, whichever occurs
// first.
func WithoutCancel(ctx context.Context) *Group {
return &Group{ctx: context.WithoutCancel(ctx)}
}

// WithTimeout create a new Group and an associated Context derived from ctx.
// given function from Go will receive context derived from this ctx,
// The derived Context is canceled when the timeout expires
Expand Down

0 comments on commit f5509a1

Please sign in to comment.