0 votes
in GoLang by
How would you print type of variable in Go?

1 Answer

0 votes
by

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)  
...