Files
the-way-to-go_ZH_CN/eBook/exercises/chapter_9/main_greetings.go
yingtaojuzi 16f2309acb when I import the pack1, if I add the ./pack1/pack1, it will fai… (#760)
* when I import the pack1, if I add the ./pack1/pack1, it will failed

* also the import exercise need updating

* the path in this file
2020-02-13 14:49:55 +08:00

23 lines
412 B
Go
Executable File

package main
import (
"./greetings"
"fmt"
)
func main() {
name := "James"
fmt.Println(greetings.GoodDay(name))
fmt.Println(greetings.GoodNight(name))
if greetings.IsAM() {
fmt.Println("Good morning", name)
} else if greetings.IsAfternoon() {
fmt.Println("Good afternoon", name)
} else if greetings.IsEvening() {
fmt.Println("Good evening", name)
} else {
fmt.Println("Good night", name)
}
}