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>
diff --git a/errgroup/errgroup_test.go b/errgroup/errgroup_test.go
index 661a070..6a9696e 100644
--- a/errgroup/errgroup_test.go
+++ b/errgroup/errgroup_test.go
@@ -43,7 +43,7 @@
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 @@
})
}
// 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.")
}
}