From a64e63227af8d3fbfed2842298e40dcf8152c32f Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Wed, 26 Jan 2011 10:41:32 -0800 Subject: [PATCH] faq: fix minor errors in programs reported by Wojciech Mikanik R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4114041 --- doc/go_faq.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/go_faq.html b/doc/go_faq.html index f923a6ae291..3f9c1d246d7 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)