Switch statements express conditionals across many branches.
Here’s a basic switch.
You can use commas for multiple expressions in the same case statement. Here, we use the optional default case as well.
switch without an expression can express if/else logic. Non-constant case expressions can be used here.
A type switch compares types instead of values. This is useful for discovering the type of an interface value. In this example, the variable t will have the type corresponding to its clause.