数组中简单使用
package main
import "fmt"
func main() {
var arr[] int = []int{1,3,5}
for index,value := range arr {
fmt.Println("索引:",index,",索引值",value)
}
}
map中简单使用
package main
import "fmt"
func main() {
cities := map[string] string {
"sz": "深圳",
"gz": "广州",
}
for k,v := range cities {
fmt.Println("键,",k, "值,",v)
}
}