Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch os := runtime.GOOS; os {
- case "darwin":
- fmt.Println("OS X.")
- case "linux":
- fmt.Println("Linux.")
- default:
- // freebsd, openbsd,
- // plan9, windows...
- fmt.Printf("%s.", os)
- }
- }
- 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