Go 语言中不可不知的语法糖,使得代码更加简洁、高效
package mainimport "fmt"// 定义接受函数作为参数的函数func apply(x int, f func(int) int) int {return f(x)}func main {result := apply(5, func(x i
package mainimport "fmt"// 定义接受函数作为参数的函数func apply(x int, f func(int) int) int {return f(x)}func main {result := apply(5, func(x i