Variables
The var statement declares one or more variables. Like function parameters, the type goes at the end.
You can use var at the package level or inside a function — this example shows both.
The var statement declares one or more variables. Like function parameters, the type goes at the end.
You can use var at the package level or inside a function — this example shows both.
package main
import "fmt"
var c, python, java bool
func main() {
var i int
fmt.Println(i, c, python, java)
} ← → Use arrow keys to navigate