Go uses if
, else if
, and else
for conditional control flow. Conditions donβt require parentheses, but braces are mandatory.
{}
are mandatory for code blocks.else if
chains multiple conditions.switch
for cleaner multiple-choice logic.if
, else if
, and else
block needs its own braces.