Skip to content

Commit 7fc1605

Browse files
AndersonQgopherbot
authored andcommitted
x/sync/errgroup: clarify docs for Go
Even thought Go cancels the context in g, if it's not nil, it'll call any subsequent function, regardless if a previous call of f returned an error or not. Fixes golang/go#54045 Change-Id: Ie6059925f45458cf393bf1fc8949ce16be8e6f2a Reviewed-on: https://go-review.googlesource.com/c/sync/+/424634 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
1 parent 886fb93 commit 7fc1605

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

errgroup/errgroup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ func (g *Group) Wait() error {
6161
// It blocks until the new goroutine can be added without the number of
6262
// active goroutines in the group exceeding the configured limit.
6363
//
64-
// The first call to return a non-nil error cancels the group; its error will be
65-
// returned by Wait.
64+
// The first call to return a non-nil error cancels the group's context, if the
65+
// group was created by calling WithContext. The error will be returned by Wait.
6666
func (g *Group) Go(f func() error) {
6767
if g.sem != nil {
6868
g.sem <- token{}

0 commit comments

Comments
 (0)