Curriculum Foundations Conditionals & switch exercise 9 · freeform
Conditionals & switch
About this theme
if/else looks familiar — no parentheses, braces required. The one new shape is the short-statement-if: if err := work(); err != nil { ... }. It scopes a temporary to the condition; you'll see this everywhere in Go. switch exists and doesn't fall through by default — closer to TypeScript's switch with implicit break than to C's.