iswbm / GolangCodingTime

Go编程时光,一个零基础入门 Golang 的教程

Home Page:http://golang.iswbm.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

c04/c04_01

utterances-bot opened this issue · comments

4.1 学习 Go 函数:理解 Go 里的函数 — Go编程时光 1.0.0 documentation

https://golang.iswbm.com/c04/c04_01.html

匿名函数一般不需要多次调用,也就是声明周期在一个相对短 的时间内就会消亡,所以可以选择匿名函数,继而有了匿名函数的两大使用场景:

  • 回调函数
  • 立即使用,不存在复用的情况