Update 02.3.md
多了一个[
This commit is contained in:
2
02.3.md
2
02.3.md
@@ -367,7 +367,7 @@ Go语言中有种不错的设计,即延迟(defer)语句,你可以在函
|
||||
|
||||
在Go中函数也是一种变量,我们可以通过`type`来定义它,它的类型就是所有拥有相同的参数,相同的返回值的一种类型
|
||||
|
||||
type typeName func(input1 inputType1 [, input2 inputType2 [, ...]) (result1 resultType1 [, ...])
|
||||
type typeName func(input1 inputType1 , input2 inputType2 [, ...]) (result1 resultType1 [, ...])
|
||||
|
||||
函数作为类型到底有什么好处呢?那就是可以把这个类型的函数当做值来传递,请看下面的例子
|
||||
|
||||
|
||||
Reference in New Issue
Block a user