mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 03:06:41 +08:00
增加注释使代码更易懂
This commit is contained in:
@@ -32,7 +32,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
func f() {
|
func f() {
|
||||||
for i := 0; i < 4; i++ {
|
for i := 0; i < 4; i++ {
|
||||||
g := func(i int) { fmt.Printf("%d ", i) }
|
g := func(i int) { fmt.Printf("%d ", i) } //此例子中只是为了演示匿名函数可分配不同的内存地址,在现实开发中,不应该把该部分信息放置到循环中。
|
||||||
g(i)
|
g(i)
|
||||||
fmt.Printf(" - g is of type %T and has value %v\n", g, g)
|
fmt.Printf(" - g is of type %T and has value %v\n", g, g)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user