Home / Function/ testBodyBindingFail() — gin Function Reference

testBodyBindingFail() — gin Function Reference

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

Function go DataBinding Mappers calls 1 called by 3

Entity Profile

Dependency Diagram

graph TD
  6824c58a_dab1_cbc3_1b0e_b918404a6f80["testBodyBindingFail()"]
  f7d8386b_8584_ee85_7449_5c65fdbabdb2["TestBindingXMLFail()"]
  f7d8386b_8584_ee85_7449_5c65fdbabdb2 -->|calls| 6824c58a_dab1_cbc3_1b0e_b918404a6f80
  20d13650_3c29_84a5_405e_fc102dca3e95["TestBindingTOMLFail()"]
  20d13650_3c29_84a5_405e_fc102dca3e95 -->|calls| 6824c58a_dab1_cbc3_1b0e_b918404a6f80
  b74193d2_91cd_43b0_e0fc_d8e75ee1e159["TestBindingYAMLFail()"]
  b74193d2_91cd_43b0_e0fc_d8e75ee1e159 -->|calls| 6824c58a_dab1_cbc3_1b0e_b918404a6f80
  2899e942_a23d_574e_8d47_d28e895c2604["requestWithBody()"]
  6824c58a_dab1_cbc3_1b0e_b918404a6f80 -->|calls| 2899e942_a23d_574e_8d47_d28e895c2604
  style 6824c58a_dab1_cbc3_1b0e_b918404a6f80 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binding/binding_test.go lines 1328–1341

func testBodyBindingFail(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.Error(t, err)
	assert.Empty(t, 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 testBodyBindingFail() do?
testBodyBindingFail() is a function in the gin codebase.
What does testBodyBindingFail() call?
testBodyBindingFail() calls 1 function(s): requestWithBody.
What calls testBodyBindingFail()?
testBodyBindingFail() is called by 3 function(s): TestBindingTOMLFail, TestBindingXMLFail, TestBindingYAMLFail.

Analyze Your Own Codebase

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

Try Supermodel Free