add values of a map golang for different key code example
Example 1: appending map into map golang
for _, note := range notes {
thisNote := map[string]string{
"Title":note.Title,
"Body":note.Body,
}
content["notes"] = append(content["notes"], thisNote)
}
Example 2: appending map into map golang
{ "notes":
{
"Title":note.Title,
"Body":note.Body,
},
{
"Title":note.Title,
"Body":note.Body,
},
{
"Title":note.Title,
"Body":note.Body,
},
}