Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Ruby’s magic underscore.
If you only need the second item in the range (the value), use the blank identifier, an underscore, to discard the first:
sum := 0 for _, value := range array { sum += value }
from: http://golang.org/doc/effective_go.html#for
There are no comments on this comment yet.
If you only need the second item in the range (the value), use the blank identifier, an underscore, to discard the first:
sum := 0 for _, value := range array { sum += value }
from: http://golang.org/doc/effective_go.html#for