Sign in
go
/
tour
/
46c6f08e2d7f37bce0a2c498b27b457fa2c8011d
/
.
/
prog
/
switch-with-no-condition.go
blob: f3bbcd878b88a861faf2aca54f09566885679ecc [
file
] [
log
] [
blame
]
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.")
}
}