Go - for ... range
Intro for ... range clause can be used to iterate 5 types of variables: array, slice, string, map and channel, and the following sheet gives a summary of the items of for ... range loops:
Type 1st Item 2nd Item Array index value Slice index value String index (rune) value (rune) Map key value Channel value Example - Iterating on slice package main import "fmt" func main() { s := [] {1,2,3} for i,v := range s { fmt.
[Read More]