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

Code Example 1

sum := 0
for i := 1; i < 5; i++ {
    sum += i
}
fmt.Println(sum) // 10 (1+2+3+4)

Code Example 2

package main

import "fmt"

func main() {
	sum := 0
	for i := 0; i < 10; i++ {
		sum += i
	}
	fmt.Println(sum)
}

Learn ReactJs, React Native from akashmittal.com