3 ms·
The Go Team regrets defining the scope of the range variables as the for statement. I am not aware of any regrets regarding the alias issue. The range variable
by BarkMore 13y ago
The Go Team regrets defining the scope of the range variables as the for statement. I am not aware of any regrets regarding the alias issue.
The range variable scope is the one big gotcha that's missing from the article. See http://golang.org/doc/faq#closures_and_goroutines http://golang.org/doc/faq#closures_and_goroutines for one discussion of the issue.