package main import ( "fmt" "reflect" ) func main() { // Will print 'int' anInt := 1234 fmt.Printf("%T\n", anInt) // Will print 'string' aString := "Hello World" fmt.Printf("%T\n", aString) // Will print 'float64' aFloat := 3.14 fmt.Printf("%T\n", aFloat) fmt.Println(reflect.TypeOf(anInt).String()) }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more