Print a Variable's Type (e.g. Int, String, Float)
·
136 words
·
1 minute read
Ever wanted to know the exact type name of the variable you’re using? The Printf
is capable of print exactly this information back out to you, like so:
|
|
Alternatively, you can also use the reflect package. The TypeOf
function will return a Type
but we convert this to a string with .String()
.
|
|