原来和其他语言一模一样,作用域的影响函数内只受函数内的影响
GO语言中的函数套函数内层函数必须是匿名函数
另外关于函数套函数返回值怎么写
func test2(y int)(func(x int)func(),int) {
a :=func(x int)func() {
return func() {}
}
return a,5
}
//就是本质一样的什么样子返回,什么样子接受
//type 别名 被定义别名的
type my_func func(x int)func()
func test2(y int)(my_func,int) {
a :=func(x int)func(){
return func() {}
}
return a,5
}