//报错
var a map[string][string]
a["name"] = "zhangsan"
//正确
a :=make(map[string]string)
a["name"] = "zhangsan"
//报错
var a map[string][string]
a["name"] = "zhangsan"
//正确
a :=make(map[string]string)
a["name"] = "zhangsan"
本文标题:go基础系列——map使用注意事项
本文链接:https://www.haomeiwen.com/subject/jsopsctx.html
网友评论