Skip to content

Glossary: Go Basics

switch

A statement that runs the first `case` matching a value, or `default` if none match. A `switch` with no value tests each case as a condition.

Where the book teaches it

Related terms

case and defaultif and else