package main //理解包的概念
import "fmt"
var (
aa = 1
bb = "kkk"
ss = true
)
func variableZeroValue() {
var a int
var s string
fmt.Printf("%d %q
",a,s)
}
func variableInitialValue() {
var a,b int = 3, 4
var s string = "abc"
fmt.Println(a,b,s)
}
func variableTypeDeduction() {
var a,b,c,s = 3,4,true,"def"
fmt.Println(a,b,c,s)
}
func variableShorted() {
a,b,c,s := 4,5,6,7
//:=只能在函数中使用,包外不能使用
b = 8
fmt.Println(a,b,c,s)
}
func main() {
fmt.Println("Hello world")
variableZeroValue()
variableInitialValue()
variableTypeDeduction()
variableShorted()
}