Go语言的defer,你真的懂了吗?
2013-04-25 Go语言的defer,你真的懂了吗? example1 func f() (result int) { defer func() { result++ }() return 0 } example2 func f() (r int) { t := 5 defer func() { t = t + 5 }() return t } example3 func f() (r int) { defer func(r int) { r = r + 5 }(r) return 1 }...阅读全文