Home / Function/ testBodyBinding() — gin Function Reference

testBodyBinding() — gin Function Reference

Architecture documentation for the testBodyBinding() function in binding_test.go from the gin codebase.

Function go DataBinding Mappers calls 1 called by 5

Entity Profile

Dependency Diagram

graph TD
  d12d65c3_6731_35cd_4722_5cc44c314d21["testBodyBinding()"]
  4a7b4cef_1dc0_9ae1_128b_c7be6a9606de["TestBindingJSON()"]
  4a7b4cef_1dc0_9ae1_128b_c7be6a9606de -->|calls| d12d65c3_6731_35cd_4722_5cc44c314d21
  c657c946_5b45_5ef8_170b_424883f31b71["TestBindingXML()"]
  c657c946_5b45_5ef8_170b_424883f31b71 -->|calls| d12d65c3_6731_35cd_4722_5cc44c314d21
  2cc7295f_b015_de20_59b5_e0662c2196ae["TestBindingTOML()"]
  2cc7295f_b015_de20_59b5_e0662c2196ae -->|calls| d12d65c3_6731_35cd_4722_5cc44c314d21
  f1f8a122_46ab_9665_d365_ffbbe0099c02["TestBindingYAML()"]
  f1f8a122_46ab_9665_d365_ffbbe0099c02 -->|calls| d12d65c3_6731_35cd_4722_5cc44c314d21
  334d51a9_6da7_2cb8_1d0e_a77cc2fd6c7f["TestBindingBSON()"]
  334d51a9_6da7_2cb8_1d0e_a77cc2fd6c7f -->|calls| d12d65c3_6731_35cd_4722_5cc44c314d21
  2899e942_a23d_574e_8d47_d28e895c2604["requestWithBody()"]
  d12d65c3_6731_35cd_4722_5cc44c314d21 -->|calls| 2899e942_a23d_574e_8d47_d28e895c2604
  style d12d65c3_6731_35cd_4722_5cc44c314d21 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binding/binding_test.go lines 1217–1230

func testBodyBinding(t *testing.T, b Binding, name, path, badPath, body, badBody string) {
	assert.Equal(t, name, b.Name())

	obj := FooStruct{}
	req := requestWithBody(http.MethodPost, path, body)
	err := b.Bind(req, &obj)
	require.NoError(t, err)
	assert.Equal(t, "bar", obj.Foo)

	obj = FooStruct{}
	req = requestWithBody(http.MethodPost, badPath, badBody)
	err = JSON.Bind(req, &obj)
	require.Error(t, err)
}

Domain

Subdomains

Frequently Asked Questions

What does testBodyBinding() do?
testBodyBinding() is a function in the gin codebase.
What does testBodyBinding() call?
testBodyBinding() calls 1 function(s): requestWithBody.
What calls testBodyBinding()?
testBodyBinding() is called by 5 function(s): TestBindingBSON, TestBindingJSON, TestBindingTOML, TestBindingXML, TestBindingYAML.

Analyze Your Own Codebase

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

Try Supermodel Free