Update 06.8.md (#800)

This commit is contained in:
Xuing
2021-10-23 11:58:28 +08:00
committed by GitHub
parent 94d5c5a077
commit 89f892e18c

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)
}