use encode replace json marshal increase json encoder speed (#1546)

This commit is contained in:
itcloudy
2019-05-22 07:48:50 +08:00
committed by 田欧
parent b1d607a899
commit 0cbf290302
5 changed files with 12 additions and 15 deletions

View File

@ -62,7 +62,7 @@ func TestRenderJSON(t *testing.T) {
err := (JSON{data}).Render(w)
assert.NoError(t, err)
assert.Equal(t, "{\"foo\":\"bar\",\"html\":\"\\u003cb\\u003e\"}", w.Body.String())
assert.Equal(t, "{\"foo\":\"bar\",\"html\":\"\\u003cb\\u003e\"}\n", w.Body.String())
assert.Equal(t, "application/json; charset=utf-8", w.Header().Get("Content-Type"))
}