bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/Go/Go Tutorial
Go•Go Tutorial

Go Nested if Statement

The Nested if Statement

You can have if statements inside if statements, this is called a nested if.

Syntax

if
condition1 {
 // code to be executed if condition1 is true
 if
 condition2 {
 // code to be executed if both condition1 and condition2 are true
 }
}
if

Previous

Go else if Statement

Next

Go switch Statement