Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "time"
- )
- func main() {
- fmt.Println("When's Saturday?")
- today := time.Now().Weekday()
- switch time.Saturday {
- case today + 0:
- fmt.Println("Today.")
- case today + 1:
- fmt.Println("Tomorrow.")
- case today + 2:
- fmt.Println("In two days.")
- default:
- fmt.Println("Too far away.")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement