增加注释使代码更易懂

This commit is contained in:
joezou
2015-10-27 22:10:52 +08:00
parent 97c6a9f796
commit 2a3500f951

View File

@@ -32,7 +32,7 @@ func main() {
}
func f() {
for i := 0; i < 4; i++ {
g := func(i int) { fmt.Printf("%d ", i) }
g := func(i int) { fmt.Printf("%d ", i) } //此例子中只是为了演示匿名函数可分配不同的内存地址,在现实开发中,不应该把该部分信息放置到循环中。
g(i)
fmt.Printf(" - g is of type %T and has value %v\n", g, g)
}