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
You should check if the map is nil and initialize one if it's nil inside the for loop:
if m["uid"] == nil { m["uid"] = map[string]T{} }