Sign in
go
/
tour
/
c7374255f627de1d833c24ab73b75f6e7c25ef75
/
.
/
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.")
}
}