for循环的三种方式:
for i := 1; i < 10; i++ {
//....
}
for {
//....
}
for k, v := range a {
//....
}
for _, v := range a {
//....
}
for i := 1; i < 10; i++ {
//....
}
for {
//....
}
for k, v := range a {
//....
}
for _, v := range a {
//....
}
2018-04-17
类型断言
var a interface{}
a = 3.14
switch a.(type) {
case int:
case float64:
case bool:
case string:
default:
}
var a interface{}
a = 3.14
switch a.(type) {
case int:
case float64:
case bool:
case string:
default:
}
2018-04-17
const (
cat string = "奥迪"
price int = "120000元"
)
cat string = "奥迪"
price int = "120000元"
)
2018-04-16
package main
import "fmt"
var a string = "zhao"
var NAME string = "qian"
type COUNT int
type person struct {}
type person interface {}
func fn() {}
func main() {}
import "fmt"
var a string = "zhao"
var NAME string = "qian"
type COUNT int
type person struct {}
type person interface {}
func fn() {}
func main() {}
2018-04-13