Skip to content

Commit fa27be9

Browse files
authored
Merge pull request #219 from gopl-zh/revert-213-patch-1
Revert "Update ch5-06.md"
2 parents feac38b + 687fb92 commit fa27be9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

ch5/ch5-06.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ strings.Map(func(r rune) rune { return r + 1 }, "HAL-9000")
1313
<u><i>gopl.io/ch5/squares</i></u>
1414
```Go
1515
// squares返回一个匿名函数。
16-
// 该匿名函数每次被调用时都会返回下一个数的平方的函数
16+
// 该匿名函数每次被调用时都会返回下一个数的平方。
1717
func squares() func() int {
1818
var x int
1919
return func() int {
@@ -23,11 +23,10 @@ func squares() func() int {
2323
}
2424
func main() {
2525
f := squares()
26-
// () 函数调用符号
27-
fmt.Println(f()()) // "1"
28-
fmt.Println(f()()) // "4"
29-
fmt.Println(f()()) // "9"
30-
fmt.Println(f()()) // "16"
26+
fmt.Println(f()) // "1"
27+
fmt.Println(f()) // "4"
28+
fmt.Println(f()) // "9"
29+
fmt.Println(f()) // "16"
3130
}
3231
```
3332

0 commit comments

Comments
 (0)