errgroup: fix build errors in errgroup_test

Change-Id: Ie5ebfa26b6234f833139784da859d32cc1416b26
Reviewed-on: https://go-review.googlesource.com/24961
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Bryan C. Mills 2016-07-15 14:34:44 -04:00 committed by Bryan Mills
commit 53cf14c8d7

View file

@ -43,7 +43,7 @@ func ExampleGroup_justErrors() {
for _, url := range urls {
// Launch a goroutine to fetch the URL.
url := url // https://golang.org/doc/faq#closures_and_goroutines
g.Go(func(url string) error {
g.Go(func() error {
// Fetch the URL.
resp, err := http.Get(url)
if err == nil {
@ -53,7 +53,7 @@ func ExampleGroup_justErrors() {
})
}
// Wait for all HTTP fetches to complete.
if err := wg.Wait(); err == nil {
if err := g.Wait(); err == nil {
fmt.Println("Successfully fetched all URLs.")
}
}