1. 첫번째 방법
[code]
str := 129.29438455
if reflect.TypeOf(str).String() != “string” {
//
}
[/code]
2. 두번째 방법
[code]
a := “34.1718000440”
switch a.(type) {
case float64:
fmt.Println(“This is float64”)
case string:
fmt.Println(“This is string”)
default:
fmt.Println(“unknown”)
}
[/code]