How to initialize multiple variable in the same line in Go

1 Answer

0 votes
package main

import "fmt"

func main() {
	var a, b, c, d = 5, 9, 1, 839

	fmt.Printf("%d %d %d %d", a, b, c, d)
}
 
 
 
/*
run:
 
5 9 1 839
 
*/

 

 



answered Aug 13, 2020 by avibootz

Related questions

...