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