Answers for "go jump back to an outer loop"

Go
0

go jump back to an outer loop

outerloop:
	for i, line := range m {
		for _, v := range line {
			if v < 0 {
				fmt.Println(v)
				break outerloop
			}
		}
	}
// Consider refactoring the nested loop into a function and use return to break out.
Posted by: Guest on February-24-2021

Browse Popular Code Answers by Language