From 83e030ac397a57e5bd5b6011efb313e0d1027523 Mon Sep 17 00:00:00 2001 From: dbarobin Date: Thu, 6 Aug 2015 16:24:05 +0800 Subject: [PATCH] [Typo] Fix multiple wrong single and double quotation marks between 04.6 to 06.9 --- eBook/04.6.md | 4 ++-- eBook/05.1.md | 2 +- eBook/05.5.md | 2 +- eBook/05.6.md | 6 +++--- eBook/06.9.md | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eBook/04.6.md b/eBook/04.6.md index 8590a97..bf7be68 100644 --- a/eBook/04.6.md +++ b/eBook/04.6.md @@ -56,8 +56,8 @@ str := "Beginning of the string " + 拼接的简写形式 `+=` 也可以用于字符串: ```go -s := “hel” + “lo,” -s += “world!” +s := "hel" + "lo," +s += "world!" fmt.Println(s) //输出 “hello, world!” ``` diff --git a/eBook/05.1.md b/eBook/05.1.md index 6130f79..a2d182c 100644 --- a/eBook/05.1.md +++ b/eBook/05.1.md @@ -94,7 +94,7 @@ return y if runtime.GOOS == "windows" { . .. - } else { // Unix - li ke + } else { // Unix-like . .. } diff --git a/eBook/05.5.md b/eBook/05.5.md index d2368eb..200b2a1 100644 --- a/eBook/05.5.md +++ b/eBook/05.5.md @@ -7,7 +7,7 @@ ```go for { i = i - 1 - fmt.Printf(“The variable i is now: %d\n”, i) + fmt.Printf("The variable i is now: %d\n", i) if i < 0 { break } diff --git a/eBook/05.6.md b/eBook/05.6.md index da4cba6..47f5126 100644 --- a/eBook/05.6.md +++ b/eBook/05.6.md @@ -86,10 +86,10 @@ i := 0 for { //since there are no checks, this is an infinite loop if i >= 3 { break } //break out of this for loop when this condition is met - fmt.Println(“Value of i is:”, i) + fmt.Println("Value of i is:", i) i++; } -fmt.Println(“A statement just after for loop.”) +fmt.Println("A statement just after for loop.") ``` 2. @@ -97,7 +97,7 @@ fmt.Println(“A statement just after for loop.”) ```go for i := 0; i<7 ; i++ { if i%2 == 0 { continue } - fmt.Println(“Odd:”, i) + fmt.Println("Odd:", i) } ``` diff --git a/eBook/06.9.md b/eBook/06.9.md index 864fd26..1bd03aa 100644 --- a/eBook/06.9.md +++ b/eBook/06.9.md @@ -124,8 +124,8 @@ addJpeg := MakeAddSuffix(“.jpeg”) 然后调用它们: ```go -addBmp(“file”) // returns: file.bmp -addJpeg(“file”) // returns: file.jpeg +addBmp("file") // returns: file.bmp +addJpeg("file") // returns: file.jpeg ``` 可以返回其它函数的函数和接受其它函数作为参数的函数均被称之为高阶函数,是函数式语言的特点。我们已经在第 6.7 中得知函数也是一种值,因此很显然 Go 语言具有一些函数式语言的特性。闭包在 Go 语言中非常常见,常用于 goroutine 和管道操作(详见第 14.8-14.9 节)。在第 11.14 节的程序中,我们将会看到 Go 语言中的函数在处理混合对象时的强大能力。