Runtime error: assignment to entry in nil map

前端 未结 4 1223
逝去的感伤
逝去的感伤 2021-01-31 12:53

I am trying to generate a map and then convert that to a yaml file like this:

uid :
      kasi:
        cn: Chaithra
        street: fkmp
      nandan:
        c         


        
4条回答
  •  忘了有多久
    2021-01-31 13:43

    You have not initialized your inner map. Before your for loop you can add m["uid"] = make(map[string]T) and then assign the name.

提交回复
热议问题