4 ms·
This catches people out, and is something that some people on the Go team have expressed regret over - unfortunately it is too late to change due to backwards c
by peterarmitage 13y ago
This catches people out, and is something that some people on the Go team have expressed regret over - unfortunately it is too late to change due to backwards compatibility promises.
http://youtu.be/p9VUCp98ay4?t=22m18s http://youtu.be/p9VUCp98ay4?t=22m18s
http://golang.org/doc/go1compat.html http://golang.org/doc/go1compat.html
- peterarmitage 13y agoSorry, I misread your comment, this isn't relevant.
- peterarmitage 13y agoSorry, I misread your comment, this isn't relevant.
- BarkMore 13y agoThe 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.