Check out example codes for "range in go". It will help you in understanding the concepts better.

Code Example 1

nums := []int{2, 3, 4}
    sum := 0
    for _, num := range nums {
        sum += num
    }
    fmt.Println("sum:", sum)

Code Example 2

for i, num := range nums {
        if num == 3 {
            fmt.Println("index:", i)
        }
    }

Code Example 3

kvs := map[string]string{"a": "apple", "b": "banana"}
    for k, v := range kvs {
        fmt.Printf("%s -> %s\n", k, v)
    }

Learn ReactJs, React Native from akashmittal.com