fix: coding style and file format for chapter 8.

This commit is contained in:
Bo-Yi Wu
2017-02-11 12:27:17 +08:00
parent d9041c7fc3
commit 6edacddbb3
2 changed files with 110 additions and 108 deletions

View File

@@ -5,8 +5,8 @@ import (
"fmt"
)
var Days = map[int]string{1:"monday",
2:"tuesday",
var Days = map[int]string{1: "monday",
2: "tuesday",
3: "wednesday",
4: "thursday",
5: "friday",
@@ -19,7 +19,7 @@ func main() {
flagHolliday := false
for k, v := range Days {
if v == "thursday" || v == "holliday" {
fmt.Println(v, " is the ", k , "th day in the week")
fmt.Println(v, " is the ", k, "th day in the week")
if v == "holliday" {
flagHolliday = true
}
@@ -29,6 +29,7 @@ func main() {
fmt.Println("holliday is not a day!")
}
}
/* Output:
thursday is the 4 th day in the week
holliday is not a day!

View File

@@ -43,6 +43,7 @@ func main() {
fmt.Printf("The french for %s is %s\n", eng, drinks[eng])
}
}
/* Output:
The following drinks are available:
wine