Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 396f3a0

Browse files
seankhliaogopherbot
authored andcommitted
errgroup: document calling Go before Wait
Fixes golang/go#70284 Change-Id: I31d60ea182226c032b0ffbddcbb5b53675dfd5e6 Reviewed-on: https://go-review.googlesource.com/c/sync/+/660075 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com> Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Damien Neil <dneil@google.com>
1 parent b637f27 commit 396f3a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

errgroup/errgroup.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
type token struct{}
1919

2020
// A Group is a collection of goroutines working on subtasks that are part of
21-
// the same overall task.
21+
// the same overall task. A Group should not be reused for different tasks.
2222
//
2323
// A zero Group is valid, has no limit on the number of active goroutines,
2424
// and does not cancel on error.
@@ -61,6 +61,7 @@ func (g *Group) Wait() error {
6161
}
6262

6363
// Go calls the given function in a new goroutine.
64+
// The first call to Go must happen before a Wait.
6465
// It blocks until the new goroutine can be added without the number of
6566
// active goroutines in the group exceeding the configured limit.
6667
//

0 commit comments

Comments
 (0)