Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "fmt"
  5. "time"
  6. )
  7.  
  8. func main() {
  9. t := time.Now()
  10. switch {
  11. case t.Hour() < 12:
  12. fmt.Println("Good morning!")
  13. case t.Hour() < 17:
  14. fmt.Println("Good afternoon.")
  15. default:
  16. fmt.Println("Good evening.")
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement