Exercises & activities from the go workshop provided by Packt: https://courses.packtpub.com/courses/go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
686 B

  1. package main
  2. import (
  3. "fmt"
  4. "time"
  5. )
  6. func main() {
  7. dayBorn := time.Monday
  8. switch dayBorn {
  9. case time.Monday:
  10. fmt.Println("Monday's child is fair of face")
  11. case time.Tuesday:
  12. fmt.Println("Tuesday's child is full of grace")
  13. case time.Wednesday:
  14. fmt.Println("Wednesday's child is fair of woe")
  15. case time.Thursday:
  16. fmt.Println("Thursday's child has far to go")
  17. case time.Friday:
  18. fmt.Println("Friday's child is loving and giving")
  19. case time.Saturday:
  20. fmt.Println("Saturday's child works hard for a living")
  21. case time.Sunday:
  22. fmt.Println("Sunday's child is bonny and blithe")
  23. default:
  24. fmt.Println("Error, day born not valid")
  25. }
  26. }