Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "time"
- )
- func main() {
- t := time.Now()
- switch {
- case t.Hour() < 12:
- fmt.Println("Good morning!")
- case t.Hour() < 17:
- fmt.Println("Good afternoon.")
- default:
- fmt.Println("Good evening.")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement