## 回调函数
package main
import "fmt"
type FuncType func (int,int) int
//函数类型作为参数
func callBack(a,b int, f FuncType) (c int){
c = f(a,b)
return
}
func test(a,b int) int{
return a*b
}
func main(){
c := callBack(1,2,test)
fmt.Println(c)
}
## 回调函数
package main
import "fmt"
type FuncType func (int,int) int
//函数类型作为参数
func callBack(a,b int, f FuncType) (c int){
c = f(a,b)
return
}
func test(a,b int) int{
return a*b
}
func main(){
c := callBack(1,2,test)
fmt.Println(c)
}