Skip to content

Instantly share code, notes, and snippets.

@monkrus
Last active January 10, 2020 21:05
Show Gist options
  • Save monkrus/98692dc0112dd2ba8e9a1b2d3699d2be to your computer and use it in GitHub Desktop.
Save monkrus/98692dc0112dd2ba8e9a1b2d3699d2be to your computer and use it in GitHub Desktop.
Nested loop in go
package main
import (
"fmt"
)
func main() {
Loop:
for i := 1; i <= 3; i++ {
for j := 1; j <= 3; j++ {
fmt.Println(i * j)
if i*j >= 3 {
break Loop
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment