Go by Example - Switch
Go by Example - Switch
com/switch
Go by Example: Switch
Switch statements express conditionals across
many branches.
package main
import (
"fmt"
"time"
)
func main() {
$ go run switch.go
Write 2 as two
It's a weekday
It's after noon
I'm a bool
I'm an int
Don't know type string
1 of 1 11/26/24, 23:27