lesson8: 函数,闭包和方法(可以再补充一点:函数高级用法)
Chao2020x opened this issue · comments
package main
import "fmt"
import "math"
// define function getSquareRoot1
func getSquareRoot1(x float64) float64 {
return math.Sqrt(x)
}
// deffine a function variable
var getSquareRoot2 = func(x float64) float64 {
return math.Sqrt(x)
}
// deffine a function variable ========================补充
var getSquareRoot3 = math.Sqrt