【GoLang】golang 中 defer 参数的蹊跷

参考资料:

http://studygolang.com/articles/7994--Defer函数调用参数的求值

golang的闭包和普通函数调用区别:http://studygolang.com/articles/356

 

结论:

闭包中参数是其地址

闭包中参数的确定是在声明时求值,而不是在调用时求值

posted @ 2016-12-23 13:30  junneyang  阅读(368)  评论(0编辑  收藏  举报