change to json encode

This commit is contained in:
Fabricio 2018-09-25 20:00:02 -03:00
parent d57ebe7d59
commit b476e72225

View file

@ -86,10 +86,9 @@ func getDashboardItemInfoHandler() http.Handler {
idInt, _ := strconv.Atoi(idStr)
for _, c := range captures {
if c.ID == idInt {
json, _ := json.Marshal(c)
res.Header().Add("Content-Type", "application/json")
res.Write([]byte(json))
return
json.NewEncoder(res).Encode(c)
break
}
}
})