This question already has an answer here:
I wondered coding style of go package when studying exporting packaging.
and found that the code of package in source(ex:"math", "fmt") has
function begins with a capital letter but no body.
I just follow this code but doesn't work.
Anyone who explain why??
func Abs(x float64) float64
func abs(x float64) float64 {
switch {
case x < 0:
return -x
case x == 0:
return 0 // return correctly abs(-0)
}
return x
}
</div>