PHP
·
发表于 5年以前
·
阅读量:8410
package main
import(
"fmt"
)
func main(){
var yk = make(map[string][]string)
yk["one"] = []string{"a123", "a456", "a789"}
fmt.Println("yk[one] len = ", len(yk["one"]))
i := len(yk["one"])
for j:=0; j<i; j++{
fmt.Println(yk["one"][j])
}
yk["two"] = []string{"b123", "b456"}
for k,v := range yk{
fmt.Println("key:", k)
fmt.Println("values:", v)
for _, vs := range v {
fmt.Println("value:", vs)
}
}
}