第141页 5.6.1 Caveat: Capture Iteration Variables
- 章节名:5.6.1 Caveat: Capture Iteration Variables
- 页码:第141页
anonymous function和for循环的一个坑,不久前就踩过。使用情景是使用 [common pool](https://github.com/jolestar/go-commons-pool) 时,common pool接受函数来初始化,用for循环结果传递函数进去,结果是只有最后一个元素得到正确初始化。
13人阅读
jeff对本书的所有笔记 · · · · · ·
-
第107页 4.4.3 Struct Embedding and Anonymous Fields
The answer has to do with methods. The shorthand notation used for selecting the fields...
-
第137页 5.6 Anonymous Functions
anonymous function 也可以递归,只不过需要额外处理
-
第141页 5.6.1 Caveat: Capture Iteration Variables
-
第143页 5.7 Variadic Functions
关于可变参数函数 1. 可变参数最少个数为0, 即不添加任何参数 2. 可变参数只能是最后一个参...
-
第146页 5.8 Deferred Function Calls
on entry 和 on exit 可以看做一种pattter了。例如衡量一个操作执行的时间
> 查看全部27篇
说明 · · · · · ·
表示其中内容是对原文的摘抄