[Typo] Fix multiple wrong single and double quotation marks

This commit is contained in:
dbarobin
2015-08-05 06:14:50 +08:00
parent e4a460f6d9
commit 03b88f2be2

View File

@@ -162,7 +162,7 @@ func main() {
```go
package main
import fmt
import "fmt"
func main() {
var n int16 = 34
@@ -171,8 +171,8 @@ func main() {
//m = n
m = int32(n)
fmt.Printf(32 bit int is: %d\n, m)
fmt.Printf(16 bit int is: %d\n, n)
fmt.Printf("32 bit int is: %d\n", m)
fmt.Printf("16 bit int is: %d\n", n)
}
```
@@ -198,7 +198,7 @@ func Uint8FromInt(n int) (uint8, error) {
if 0 <= n && n <= math.MaxUint8 { // conversion is safe
return uint8(n), nil
}
return 0, fmt.Errorf(%d is out of the uint8 range, n)
return 0, fmt.Errorf("%d is out of the uint8 range", n)
}
```
@@ -213,7 +213,7 @@ func IntFromFloat64(x float64) int {
}
return int(whole)
}
panic(fmt.Sprintf(%g is out of the int32 range, x))
panic(fmt.Sprintf("%g is out of the int32 range", x))
}
```
@@ -234,7 +234,7 @@ Go 拥有以下复数类型:
```go
var c1 complex64 = 5 + 10i
fmt.Printf(The value is: %v, c1)
fmt.Printf("The value is: %v", c1)
// 输出: 5 + 10i
```
@@ -447,14 +447,14 @@ func main() {
```go
package main
import fmt
import "fmt"
type TZ int
func main() {
var a, b TZ = 3, 4
c := a + b
fmt.Printf(c has the value: %d, c) // 输出c has the value: 7
fmt.Printf("c has the value: %d", c) // 输出c has the value: 7
}
```
@@ -469,7 +469,7 @@ func main() {
在 ASCII 码表中A 的值是 65而使用 16 进制表示则为 41所以下面的写法是等效的
```go
var ch byte = 65 var ch byte = \x41
var ch byte = 65 var ch byte = '\x41'
```
`\x` 总是紧跟着长度为 2 的 16 进制数)
@@ -485,13 +485,13 @@ var ch byte = 65 或 var ch byte = \x41
示例 4.12 [char.go](examples/chapter_4/char.go)
```go
var ch int = \u0041
var ch2 int = \u03B2
var ch3 int = \U00101234
fmt.Printf(%d - %d - %d\n, ch, ch2, ch3) // integer
fmt.Printf(%c - %c - %c\n, ch, ch2, ch3) // character
fmt.Printf(%X - %X - %X\n, ch, ch2, ch3) // UTF-8 bytes
fmt.Printf(%U - %U - %U, ch, ch2, ch3) // UTF-8 code point
var ch int = '\u0041'
var ch2 int = '\u03B2'
var ch3 int = '\U00101234'
fmt.Printf("%d - %d - %d\n", ch, ch2, ch3) // integer
fmt.Printf("%c - %c - %c\n", ch, ch2, ch3) // character
fmt.Printf("%X - %X - %X\n", ch, ch2, ch3) // UTF-8 bytes
fmt.Printf("%U - %U - %U", ch, ch2, ch3) // UTF-8 code point
```
输出: