
- Go Tutorial
- Go - Home
- Go - Overview
- Go - Environment Setup
- Go - Program Structure
- Go - Basic Syntax
- Go - Data Types
- Go - Variables
- Go - Constants
- Go - Operators
- Go - Decision Making
- Go - Loops
- Go - Functions
- Go - Scope Rules
- Go - Strings
- Go - Arrays
- Go - Pointers
- Go - Structures
- Go - Slice
- Go - Range
- Go - Maps
- Go - Recursion
- Go - Type Casting
- Go - Interfaces
- Go - Error Handling
- Go Useful Resources
- Go - Questions and Answers
- Go - Quick Guide
- Go - Useful Resources
- Go - Discussion
Go - The continue Statement
The continue statement in Go programming language works somewhat like a break statement. Instead of forcing termination, a continue statement forces the next iteration of the loop to take place, skipping any code in between.
In case of the for loop, continue statement causes the conditional test and increment portions of the loop to execute.
Syntax
The syntax for a continue statement in Go is as follows −
continue;
Flow Diagram

Example
package main import "fmt" func main() { /* local variable definition */ var a int = 10 /* do loop execution */ for a < 20 { if a == 15 { /* skip the iteration */ a = a + 1; continue; } fmt.Printf("value of a: %d\n", a); a++; } }
When the above code is compiled and executed, it produces the following result −
value of a: 10 value of a: 11 value of a: 12 value of a: 13 value of a: 14 value of a: 16 value of a: 17 value of a: 18 value of a: 19
go_loops.htm
Advertisements