摘要: 在对map的值进行赋值操作时,如果map的值类型为struct结构体类型,那么是不能直接对struct中的字段进行赋值的。 例如: type T struct { n int } func main(){ m := make(map[int]T) m[0].n = 1 //map[key]struc 阅读全文
posted @ 2021-03-07 21:42 无_忧 阅读(279) 评论(0) 推荐(0) 编辑