diff --git a/examples/waitgroups/waitgroups.go b/examples/waitgroups/waitgroups.go index 5ac70b52f..a8a446a2d 100644 --- a/examples/waitgroups/waitgroups.go +++ b/examples/waitgroups/waitgroups.go @@ -29,10 +29,6 @@ func main() { // counter for each. for i := 1; i <= 5; i++ { wg.Add(1) - // Avoid re-use of the same `i` value in each goroutine closure. - // See [the FAQ](https://golang.org/doc/faq#closures_and_goroutines) - // for more details. - i := i // Wrap the worker call in a closure that makes sure to tell // the WaitGroup that this worker is done. This way the worker diff --git a/examples/waitgroups/waitgroups.hash b/examples/waitgroups/waitgroups.hash index 5fdeaf5d4..5dc808bec 100644 --- a/examples/waitgroups/waitgroups.hash +++ b/examples/waitgroups/waitgroups.hash @@ -1,2 +1,2 @@ -66d1c1cdb7e60f63b9b30938aa9c63b2262463ac -S98GjeaGBX0 +c81a54fed0cd96464456e05b46163329eb7c958b +fC_Chrkb5uA diff --git a/public/waitgroups b/public/waitgroups index 6b4465f34..6e9fdf477 100644 --- a/public/waitgroups +++ b/public/waitgroups @@ -42,7 +42,7 @@ use a wait group.

- +
package main
@@ -122,19 +122,6 @@ counter for each.

- - -

Avoid re-use of the same i value in each goroutine closure. -See the FAQ -for more details.

- - - - -
        i := i
- - -

Wrap the worker call in a closure that makes sure to tell @@ -230,7 +217,7 @@ is likely to be different for each invocation.