Is it possible to declare multiple variables at once using Golang?
For example in Python you can type this:
a = b = c = 80
and all values will be 80.
Is it possible to declare multiple variables at once using Golang?
For example in Python you can type this:
a = b = c = 80
and all values will be 80.
Yes, you can:
var a, b, c string
a = "foo"
fmt.Println(a)
You can do something sort of similar for inline assignment, but not quite as convenient:
a, b, c := 80, 80, 80