From 53cf14c8d7596ec5230669db938d396db1bba8a7 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 15 Jul 2016 14:34:44 -0400 Subject: [PATCH] errgroup: fix build errors in errgroup_test Change-Id: Ie5ebfa26b6234f833139784da859d32cc1416b26 Reviewed-on: https://go-review.googlesource.com/24961 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- errgroup/errgroup_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 @@ 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.") } }