[Go] panic: assignment to entry in nil map

以上错误出现在给 map 变量赋值的时候。 例如: type AbMap map[string]string var abMap AbMap abMap['a'] = 'b' 使用 map 变量需要使用 make 初始化,然后才能赋值。 type AbMap map[string]string ab

posted on 2020-09-15 22:33  ercom  阅读(1632)  评论(0编辑  收藏  举报