首页 > 代码库 > A Tour of Go Variables

A Tour of Go Variables

The var statement declares a list of variables; as in function argument lists, the type is last.

 

package main import "fmt"var i intvar c, python, java boolfunc main() {    fmt.Println(i, c, python, java)}

 类型是必须的,否则会报错

A Tour of Go Variables