Go 函数值 Go 引用传递 Go 函数闭包 Go 函数值 package main import ( "fmt" "math" ) func main(){ /* declare a function variable */ getSquareRoot := func(x float64) float64 { return math.Sqrt(x) } /* use the function */ fmt.Println(getSquareRoot(9)) } Go 引用传递 Go 函数闭包