```go
package main
import (
"fmt"
)
type personInfo struct {
ID string
Name string
Address string
}
var (
number map[string]int
myapp map[string]personInfo
)
func main() {
number = make(map[string]int, 3)
number := map[string]int{
"aaa": 1,
"bbb": 2,
"ccc": 3,
}
myapp := make(map[string]personInfo)
myapp["p1"] = personInfo{"1", "Amiee", "Street 101"}
myapp["p2"] = personInfo{"2", "Beva", "Street 102"}
myMap := map[string]personInfo{
"a": {"1", "Amiee", "Street 101"},
}
fmt.Println(myMap["a"])
fmt.Println(number)
}
```
有疑问加站长微信联系(非本文作者))