break out from internal loop (labels)
examples/for-label/for_label.go
package main import ( "fmt" ) func main() { OUT: for i := 1; i < 5; i++ { for j := i; j < 5; j++ { k := i * j if k > 10 { break OUT } fmt.Println(k) } } }
1 2 3 4 4 6 8 9
package main import ( "fmt" ) func main() { OUT: for i := 1; i < 5; i++ { for j := i; j < 5; j++ { k := i * j if k > 10 { break OUT } fmt.Println(k) } } }
1 2 3 4 4 6 8 9