Go variables of different types can be declared in one go using type inference.
package main import "fmt" func main() { var a, b, c = 3, 4, "foo" fmt.Println(a) fmt.Println(b) fmt.Println(c) fmt.Printf("a is of type %T\n", a) fmt.Printf("b is of type %T\n", b) fmt.Printf("c is of type %T\n", c) }
When the above code is compiled and executed, it produces the following result:
3 4 foo a is of type int b is of type int c is of type string