Learn Go: Conditionals
If you want to learn about implementing conditionals in Go, you've come to the right place!
StartKey Concepts
Review core concepts you need to learn to master this subject
Go If Statement
Go else Statement
Go Comparison Operators
Go Logical Operators
Go Else If Statement
Go Short Variable Declaration
Go Switch Statement
Go Seed Value
Go If Statement
Go If Statement
A Go if
statement evaluates a condition and executes a statement block enclosed in curly braces {..}
if the evaluation returns true
. The condition may be optionally enclosed inside a pair of parentheses (...)
.
if (healthy) { fmt.Println("Work.") } if sick { fmt.Println("Stay home.") }
Learn Go: Conditionals
Lesson 1 of 1
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory