diff --git a/doc/go_faq.html b/doc/go_faq.html index f923a6ae29..3f9c1d246d 100644 --- a/doc/go_faq.html +++ b/doc/go_faq.html @@ -793,7 +793,7 @@ Consider the following program: func main() { done := make(chan bool) - values = []string{ "a", "b", "c" } + values := []string{ "a", "b", "c" } for _, v := range values { go func() { fmt.Println(v) @@ -802,7 +802,7 @@ func main() { } // wait for all goroutines to complete before exiting - for i := range values { + for _ = range values { <-done } } @@ -823,7 +823,7 @@ could modify the inner loop to read:
 	for _, v := range values {
-		go func(u) {
+		go func(u string) {
 			fmt.Println(u)
 			done <- true
 		}(v)