News for hackers. Stuff that matters.
Re:Philosophy and "for" loops — more from Go and Rust by codezero on Thursday July 11, 2013 @06:00PM (#6029543)
It's a slightly pedantic thing, but since the article is about the syntax of the loops, the author has misused the range loop in most cases.

When you only provide one variable for assignment, you are actually assigning the key (or incremental value), not the value, the syntax is:

  for key, value: := range someThing {
When you do:

  for something := range someThing {
something won't have the value. If you just want the value you need to use:

  for _, value := range someThing {

There are no comments on this comment yet.