Conditional Statements and Loops
Learn how to make decisions and repetitions in Go.
Conditional statements
Conditional statements perform various actions based on specific conditions. The developer specifies one or more conditions that the program executes. Particular statements are returned based on the outcome. Go uses logical and comparison operators to create conditions for different decisions. We’re going to explore the following:
- The
if
statement - The
if else
statement - The
else if
statement - The nested
if
statement - The
switch
statement
Get hands-on with 1400+ tech skills courses.