How to write isNumeric function in Golang?
@Tiago César Oliveira mentioned "Inf" or "infinity", so "NaN" could be a problem too.
Mixed it all together (only want numbers, nothing else).
func IsNumeric(s string) bool {
value, err := strconv.ParseFloat(s, 64)
if err != nil {
return false
}
return !(math.IsInf(value, 0) || math.IsNaN(value))
}