Question : golang typeof
Answered by : nasty-newt-j11bxm5nc3cq
package main
import ( "fmt" "reflect"
)
func main() { tst := "string" tst2 := 10 tst3 := 1.2 fmt.Println(reflect.TypeOf(tst)) fmt.Println(reflect.TypeOf(tst2)) fmt.Println(reflect.TypeOf(tst3))
}
Source : https://stackoverflow.com/questions/20170275/how-to-find-the-type-of-an-object-in-go | Last Update : Thu, 15 Jul 21