// Infinite for {} Loop
package main
import "fmt"
func main() {
count := 0
for { // infinite loop
fmt.Println("Iteration:", count)
if count == 3 {
fmt.Println("Breaking out of loop...")
break
}
count++
}
fmt.Println("Loop finished.")
}
/*
run:
Iteration: 0
Iteration: 1
Iteration: 2
Iteration: 3
Breaking out of loop...
Loop finished.
*/