learn go anonymous function
2015-11-22 18:14
393 查看
package main // 参考文档: // https://github.com/Unknwon/the-way-to-go_ZH_CN/blob/master/eBook/06.8.md import "fmt" func main() { f() } func f() { for i := 0; i < 4; 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) } }
相关文章推荐
- learn go function callback
- learn go recursive
- 《Go语言入门》如何在Windows下安装Go语言编程环境
- learn go passing variable-length arguments
- HDU 4268 Alice and Bob
- poj 2196 Going Home(最小费用最大流)
- Thinking in Google Doc - ActionBar讲解
- Thinking in Google Doc-不同设备适配
- learn go error
- hdu 5546 Ancient Go
- django初探
- Golang热加载配置实践
- Go语言程序测试
- learn go random
- Go 语言运算符
- Go 语言常量
- 使用Blender创造一个Low Polygon 插画
- Go 语言变量
- Go 语言数据类型
- Go 语言基础语法