Go uses a single `for` loop construct that supports standard, while, and infinite loop patterns by adjusting its three components.
Go has only one loop construct: the for loop, which handles standard iteration, while-loops, and infinite loops.
// Standard loop with initialization, condition, and post-statement
for i := 0; i < 10; i++ {
fmt.Println(i)
}
// While-loop style (omit init and post)
for i < 10 {
fmt.Println(i)
i++
}
// Infinite loop (omit condition)
for {
fmt.Println("running forever")
}
Go uses a single for keyword for all looping needs instead of separate while or do-while statements. You control the loop by including or omitting the initialization, condition, and update steps inside the parentheses. Think of it as a Swiss Army knife that adapts to any repetition pattern you need.