Go
GoPrimer
Modules
fr
en
< Back to modules
Control flow
if, the for loop, and switch: everything you need to direct execution.
1
if / else
Go's conditional structure, with no parentheses around the condition.
2
for, the only loop
Go has only one looping keyword, with four ways to use it.
3
switch
A readable alternative to long if/else chains, without the fallthrough trap.