Go has exactly one looping construct: the for loop. This might seem limiting, but it's surprisingly flexible. The basic syntax has components: initialization, condition, and post statement.
for i := 0; i < 5; i++ {
fmt.Println(i)
}
This prints through . The loop runs while the condition is true, executing the post statement after each iteration.