Compare commits

..

4 Commits

Author SHA1 Message Date
Tim 5776d48f2f
Merge 525e4354a4 into e46bd52185 2024-11-21 06:54:17 +00:00
TimAndy 525e4354a4 Add custom json codec examples in doc file 2024-11-21 14:43:08 +08:00
TimAndy 8363db7e38 feat: support custom json codec at runtime 2024-11-21 14:43:06 +08:00
TimAndy 672d629c23 Export json codec 2024-11-21 14:43:04 +08:00
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ func TestCustomJsonCodec(t *testing.T) {
//test encode json
w := httptest.NewRecorder()
err2 := (render.PureJSON{Data: obj}).Render(w)
assert.NoError(t, err2)
require.NoError(t, err2)
assert.Equal(t, "{\"time_empty\":null,\"time_struct\":\"2001-12-05 10:01:02.345\",\"time_nil\":null,\"time_pointer\":\"2002-12-05 10:01:02.345\"}\n", w.Body.String())
assert.Equal(t, "application/json; charset=utf-8", w.Header().Get("Content-Type"))
}