I have an array like List of my data as JSON. //
[
{
"ID": 1,
....
"ClosedAt": "nine"
},
...
]
I want to combine 2 arrays like and I tried to append them. -combine -append
[
{
"ID": 1,
....
"ClosedAt": "nine"
},
{
"ID": 2,
....
"ClosedAt": "nine"
},
{
"ID": 3,
....
"ClosedAt": "nine"
},
...
{
"totalpage": 10,
},
]
Controller
tickets, ptotal, err := models.GetAllTicket(query, fields, sortby, order, offset, limit)
if err != nil {
i.Data["json"] = err.Error()
} else {
i.Data["json"] = ptotal
i.Data["json"] = tickets
}
i.ServeJSON()
Beego(golang) API return JSON
Hope it's you want