Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: go-pay/errgroup
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.2
Choose a base ref
...
head repository: go-pay/errgroup
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 12, 2024

  1. add WithoutCancel()

    iGoogle-ink committed Nov 12, 2024
    Copy the full SHA
    f5509a1 View commit details
Showing with 9 additions and 0 deletions.
  1. +9 −0 errgroup.go
9 changes: 9 additions & 0 deletions errgroup.go
Original file line number Diff line number Diff line change
@@ -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