Just discovered Go, and am very curious so far. I know I m just being lazy, but I want to know if it is possible to initialize multiple variables in an if statement. I know that the following is possible:
if x := 5; x == 5 {
fmt.Printf("Whee!
")
}
I ve tried the following:
if x := 5, y := 38; x == 5 {
fmt.Printf("Whee! %d
", y)
}
if x := 5 && y := 38; x == 5 {
fmt.Printf("Whee! %d
", y)
}
But neither worked. I looked over the documentation on the Go website, so is there anything I am missing or is this simply not possible?