Home / Function/ TestRenderPureJSON() — gin Function Reference

TestRenderPureJSON() — gin Function Reference

Architecture documentation for the TestRenderPureJSON() function in render_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  c6c8e43f_9b94_0c9b_66bd_e332c7c8ea3f["TestRenderPureJSON()"]
  067a4839_481a_7bd8_fc59_5c8c3313879c["render_test.go"]
  c6c8e43f_9b94_0c9b_66bd_e332c7c8ea3f -->|defined in| 067a4839_481a_7bd8_fc59_5c8c3313879c
  style c6c8e43f_9b94_0c9b_66bd_e332c7c8ea3f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

render/render_test.go lines 240–250

func TestRenderPureJSON(t *testing.T) {
	w := httptest.NewRecorder()
	data := map[string]any{
		"foo":  "bar",
		"html": "<b>",
	}
	err := (PureJSON{data}).Render(w)
	require.NoError(t, err)
	assert.JSONEq(t, "{\"foo\":\"bar\",\"html\":\"<b>\"}\n", w.Body.String())
	assert.Equal(t, "application/json; charset=utf-8", w.Header().Get("Content-Type"))
}

Subdomains

Frequently Asked Questions

What does TestRenderPureJSON() do?
TestRenderPureJSON() is a function in the gin codebase, defined in render/render_test.go.
Where is TestRenderPureJSON() defined?
TestRenderPureJSON() is defined in render/render_test.go at line 240.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free