SHARE
TWEET

Untitled

a guest Oct 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top