Shadowtail
0
Q:

go switch case

switch time {
	case "morning":
		fmt.Println("Time to wake up!")
	case "night":
  		fmt.Println("Time to go to bed.")
	default:
  		fmt.Println("Enjoy life")
}
3
    switch time.Now().Weekday() {
    case time.Saturday, time.Sunday:
        fmt.Println("It's the weekend")
    default:
        fmt.Println("It's a weekday")
    }
2

New to Communities?

Join the community