The break statement terminates the loop when it is encountered. For example,
Here, irrespective of the condition of the Go for loop, the break statement terminates the loop.

Output
In the above example, we have used the for loop to print the value of i. Notice the use of the break statement,
Here, when i is equal to 3, the break statement terminates the loop. Hence, the output doesn't include values after 2.
When we use the break statement with nested loops, it terminates the inner loop. For example,
Output
In the above example, we have used the break statement inside the inner for loop.
Here, when the value of i is 2, the break statement terminates the inner for loop.
Hence, we didn't get any output for value i = 2.
In Go, the continue statement skips the current iteration of the loop. It passes the control flow of the program to the next iteration. For example,
Here, irrespective of the condition of the Go for loop, the continue statement skips the current iteration of the loop.

Output
In the above example, we have used the for loop to print the value of i. Notice the use of the continue statement,
Here, when i is equal to 3, the continue statement is executed. Hence, it skips the current iteration and starts the next iteration. The value 3 is not printed to the output.
When we use the continue statement with nested loops, it skips the current iteration of the inner loop. For example,
Output
In the above example, we have used the continue statement inside the inner for loop.
Here, when the value of j is 2, the continue statement is executed. Hence, the value of j = 2 is never displayed in the output.
The break and continue statement is almost always used with decision-making statements. To learn about decision-making, visit Golang if else.