mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:43:26 +08:00
修正英文括号 --> 中文全角括号
This commit is contained in:
@@ -37,7 +37,7 @@ func (tn *TwoInts) String() string {
|
||||
输出:
|
||||
|
||||
two1 is: (12/10)
|
||||
two1 is: (12/10)
|
||||
two1 is: (12/10)
|
||||
two1 is: *main.TwoInts
|
||||
two1 is: &main.TwoInts{a:12, b:10}
|
||||
|
||||
@@ -45,7 +45,7 @@ func (tn *TwoInts) String() string {
|
||||
|
||||
**备注**
|
||||
|
||||
不要在 `String()` 方法里面调用涉及 `String()` 方法的方法,它会导致意料之外的错误,比如下面的例子,它导致了一个无限迭代(递归)调用(`TT.String()` 调用 `fmt.Sprintf`,而 `fmt.Sprintf` 又会反过来调用 `TT.String()`...),很快就会导致内存溢出:
|
||||
不要在 `String()` 方法里面调用涉及 `String()` 方法的方法,它会导致意料之外的错误,比如下面的例子,它导致了一个无限迭代(递归)调用(`TT.String()` 调用 `fmt.Sprintf`,而 `fmt.Sprintf` 又会反过来调用 `TT.String()`...),很快就会导致内存溢出:
|
||||
|
||||
```go
|
||||
type TT float64
|
||||
|
Reference in New Issue
Block a user