Sunday, 6 September 2015

Advanced Go: Range

Range

The range form of the for loop iterates over a slice or map.


Range continued

You can skip the index or value by assigning to _.
If you only want the index, drop the ", value" entirely.



Do like it, if you found it usefull.

No comments:

Post a Comment