I have written a go program for giving json as a response to the httpRequest,but i am able to create json in this format only :
{
"Country": [
"abc",
"def",
],
"Population": [
"8388344",
"343",
]
}
The content types are dynamically defined using map[string]string.Can someone please help me out to give the json in the below format:
[
{
"Country" :"abc",
"Population" :"8388344"
},
{
"Country" : "def",
"Population" :"343"
},
...
]
Please help me out..