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 have not initialized your inner map. Before your for loop you can add m["uid"] = make(map[string]T) and then assign the name.
m["uid"] = make(map[string]T)