Go Loops

Go uses for for repetition. The counter starts at one, the condition is checked before each pass, and i++ advances it.

Go
package main
import "fmt"
func main() {
  for i := 1; i <= 3; i++ {
    fmt.Println(i)
  }
}
Read the full lesson