Login
Remember
Register
Ask a Question
How would you print type of variable in Go?
0
votes
asked
Aug 19, 2022
in
GoLang
by
john ganales
How would you print type of variable in Go?
print-type
golang
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Aug 19, 2022
by
john ganales
You have to use the following code to print the type of a variable:
var a, b, c = 3, 4, "foo"
fmt.Printf("a is of type %T\n", a)
...