- break
break out from loop
examples/break-loop/break_loop.go
package main import ( "fmt" ) func main() { i := 0 for { fmt.Println(i) i++ if i > 5 { break } fmt.Println("tail") } fmt.Println("after loop") }
0 tail 1 tail 2 tail 3 tail 4 tail 5 after loop