Merge pull request #42 from Itachish/master

修改函数参数类型
This commit is contained in:
astaxie
2012-09-21 22:48:48 -07:00

2
2.3.md
View File

@@ -385,7 +385,7 @@ Go里面有一个不错的设计就是回调函数有点类似面向对象
}
//声明的函数类型在这个地方当做了一个参数
func filter(slice []int, f test_int) []int {
func filter(slice []int, f testInt) []int {
var result []int
for _, value := range slice {
if f(value) {