change parameters type to func type

This commit is contained in:
zack
2012-09-22 10:56:54 +08:00
parent b968a7fa9c
commit 0d9d741b1b

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) {