Commit Graph

93 Commits

Author SHA1 Message Date
L1nSn0w
a08a8f4162 Revise chapter 5.6 on anonymous functions and closures
This section introduces anonymous functions in Go, explaining their syntax, usage, and implications in terms of closures and lexical environments. It also discusses common pitfalls related to variable capture in loops and provides examples of breadth-first search and topological sorting.
2025-09-02 15:44:42 +08:00
chai2010
687fb92030 Revert "Update ch5-06.md" 2024-04-03 16:09:26 +08:00
Acaibrid
8df9c1211c Update ch5-06.md
返回的是一个函数,而不是返回的这个函数被调用后的返回值
2024-02-05 01:32:21 +08:00
FireAndIceCoder
4139bfabf3 fix: typo
Update ch5-02.md
2023-05-07 22:46:29 +08:00
HengYi Wei
a1ad719a03 Update ch5-09.md
翻译问题
2022-10-08 13:57:32 +08:00
Asakijz
f6bb64ce09 Update ch5-10.md
原文为:deferred函数帮助Parse从panic中恢复。

应该是 recover函数吧
2022-09-05 16:47:45 +08:00
Asakijz
f9ccbec80e Update ch5-08.md
同上次一样,结尾加粗样式丢失
2022-09-05 11:25:18 +08:00
Asakijz
86e9ec1d28 Update ch5-07.md
结尾处未加缩进样式丢失
2022-09-02 15:20:07 +08:00
chai2010
3a20d238d9 清理文件 2022-08-04 15:15:13 +08:00
chai2010
06a1bdf735 转为 mdbook 2022-08-04 14:58:52 +08:00
sulingr
410a48ca14 Update ch5-09.md
修改拼写错误
2021-09-18 10:46:17 +08:00
ralt0
2d1bdc0cfe 修正ch5-05单词缺少字符 2021-04-26 08:04:43 +08:00
Jun10ng
fac168795c Update ch5-06.md
之前的翻译有些许晦涩,没有表达出主要意思。查阅原文后重新翻译。
请谨慎合并。
2020-04-27 22:13:59 +08:00
Xargin
bd506de4eb Merge pull request #83 from Hongbo-Miao/patch-2
chore: update switch case code format
2020-03-21 22:03:02 +08:00
Hongbo Miao
373cc5de79 chore: update switch case code format
嗯 就是个格式问题,case 前面没有空格。
2020-03-12 18:19:13 +08:00
Hongbo Miao
252edd5485 fix: variadic function 2020-03-12 13:09:52 +08:00
cmatrix
1cd8d117dc 修正一处拼写错误 2020-02-02 17:45:17 +08:00
Xargin
db60748fa6 Merge pull request #77 from caimaoy/patch-1
Update ch5-08.md
2019-12-24 19:13:20 +08:00
Yue Chen
65ee267d20 Update ch5-09.md
修改源码和文件出处
2019-12-10 17:12:31 +08:00
Yue Chen
8920b4102e Update ch5-08.md
修改输出
2019-12-10 16:05:07 +08:00
Xargin
7fbf986ec2 fix typo
diff --git a/ch5/ch5-06.md b/ch5/ch5-06.md
index b7e8d65..ebaabd0 100644
--- a/ch5/ch5-06.md
+++ b/ch5/ch5-06.md
@@ -91,7 +91,7 @@ func topoSort(m map[string][]string) []string {
 }
 ```

-当匿名函数需要被递归调用时,我们必须首先声明一个变量(在上面的例子中,我们首先声明了 visitAll),再将匿名函数赋值给这个变量。如果不分成两部,函数字面量无法与visitAll绑定,我们也无法递归调用该匿名函数。
+当匿名函数需要被递归调用时,我们必须首先声明一个变量(在上面的例子中,我们首先声明了 visitAll),再将匿名函数赋值给这个变量。如果不分成两步,函数字面量无法与visitAll绑定,我们也无法递归调用该匿名函数。

 ```Go
 visitAll := func(items []string) {
2018-09-26 10:40:16 +08:00
kimw
7ebd75aeae 修正半角标点符号 2018-06-09 16:36:07 +00:00
Xargin
a81bfabcdc Merge pull request #60 from howudoing/master
Update ch5-08.md
2018-05-30 12:52:15 +08:00
howudoing
4d25d2e6c4 Update ch5-08.md
修复拼写错误
2018-05-29 16:13:38 +08:00
kimw
0ab7557665 修正半角标点符号 2018-05-27 17:56:55 -04:00
wahaha
3d3ebe7235 Update ch5-03.md 2018-05-22 16:05:42 +08:00
Cloud
1788b095fd fix typo 2018-03-31 00:47:24 +08:00
kangxiaoning
f619a6ebd4 Fix a typo 2018-03-09 17:38:51 +08:00
kangxiaoning
76161c4b22 Fix a typo 2018-03-09 17:20:43 +08:00
kangxiaoning
a3473cf0f6 Fix a typo 2018-03-09 17:15:27 +08:00
wukoo
3f8f4a0531 Update ch5-04-1.md
翻译错误。
2018-01-01 16:43:56 +08:00
MiFalyzz
740cc92d15 Update ch5-07.md
interface{} 而不是 interfac{}
2017-11-30 11:25:28 +08:00
JimLee1996
d28d4fb53a 修改翻译中的小问题
The function and arguemnt expressions are evaluated when the staement is executed, butt the actual call is deferred until the function that contains... 
原文翻译很有歧义望修改!
2017-11-21 14:32:14 +08:00
zhliner
ff3c5b0a70 第5章,部分字词修订。 2017-08-24 22:27:42 +08:00
Bo Wang
52a73b7e75 fix typo error 2017-07-11 22:06:42 +08:00
Xargin
2c54595c80 fix code typo 2017-03-15 15:18:24 +08:00
Xargin
ef92399241 fix typo 2017-02-21 17:48:04 +08:00
Xargin
d19d669661 润色。 2016-12-12 16:17:05 +08:00
Xargin
853e2ad052 fix typo 2016-09-30 21:56:19 +08:00
jxskiss
6be131ac34 Fix error building with pandoc. 2016-09-28 02:16:15 +08:00
Xargin
2b2529d2cc fix typo 2016-09-22 14:13:24 +08:00
chai2010
2b37b23285 回到简体 2016-02-15 11:06:34 +08:00
chai2010
dc16c5b6c7 fmt code 2016-01-27 18:06:08 +08:00
chai2010
ce4694ad30 fix format 2016-01-27 17:49:40 +08:00
chai2010
20a8cf71b9 ch5: fix code path 2016-01-21 09:58:28 +08:00
ZhiFeng Hu
b06319b007 Fix typo rumtime => runtime
Signed-off-by: ZhiFeng Hu <hufeng1987@gmail.com>
2016-01-20 10:56:36 +08:00
ZhiFeng Hu
a7179c1f62 Fix typo , => . 2016-01-20 10:53:52 +08:00
chai2010
e16eebfefa Fix typo
Fixes #204
2016-01-18 12:07:14 +08:00
chai2010
9666211cd7 Fix typo
Fixes #198
2016-01-18 11:22:04 +08:00
chai2010
884ada9cd0 fmt 2016-01-18 11:14:19 +08:00