In go, why there is no function which directly calculates absolute value for integer datatypes. Currently all integer values has to be type casted to float64 and then it has to be used as a parameter in math.Abs() function. And it returns float64 datatype only, which again has to be type casted into integer datatype.
Like this code is giving error as Go is statically typed language, so does not allows different datatype.
./prog.go:12:39: cannot use x (type int64) as …