Created
January 6, 2021 20:32
-
-
Save tmathews/500646813d34ad2d32b0d8a12327c033 to your computer and use it in GitHub Desktop.
Greeting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Greeting() string { | |
greeting := "こんにちわ!" | |
now := time.Now().Hour() | |
if now > 2 && now < 10 { | |
greeting = "おはよう!" | |
} else if now >= 18 { | |
greeting = "こんばんわ" | |
} | |
return greeting | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment