![2015-10-08 16:31:15屏幕截图.png](http://studygolang.qiniudn.com/151008/e0a9d9b950092b1581fbf4fafbc66c93.png)
是因为我的go版本不对吗?
package main
import "fmt"
//PersonInfo是一个包含个人信息的类型
type PersonInfo struct{
ID string
Name string
Address string
}
func main(){
//personDB:=make(map[string] PersonInfo)
//personDB=make(map[string] PersonInfo,2)
//往这个map里插入几条数据
myMap:=map[string]struct {x,y int}{"a":{0,1}}
fmt.Println(myMap)
personDB:=map[string] PersonInfo {
"1234":PersonInfo{"123", "Jack", "Room 101"}
}
person:=PersonInfo{"123", "Jack", "Room 101,..."}
personDB["123"]=person
personDB["1"]=PersonInfo{"1","Jack","the Room 102"}
//从这个map查找键值为”123“的信息
person,ok:=personDB["123"]
if ok{
fmt.Println("Found person",person)
}else{
fmt.Println("Did not find person!")
}
//delete personDB["1"]
}
#1