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 RequestBinding FormBinding calls 1 called by 3

Entity Profile

Dependency Diagram

graph TD
  209cb087_f0fd_de62_3ba8_952202b2f044["testBodyBindingFail()"]
  314c6481_2bd0_e5a7_282c_94e41df6062a["binding_test.go"]
  209cb087_f0fd_de62_3ba8_952202b2f044 -->|defined in| 314c6481_2bd0_e5a7_282c_94e41df6062a
  3c6fd45f_63a6_90a9_4f91_7402e224a53e["TestBindingXMLFail()"]
  3c6fd45f_63a6_90a9_4f91_7402e224a53e -->|calls| 209cb087_f0fd_de62_3ba8_952202b2f044
  13c9e6cd_0493_024e_1236_1b34b7c47117["TestBindingTOMLFail()"]
  13c9e6cd_0493_024e_1236_1b34b7c47117 -->|calls| 209cb087_f0fd_de62_3ba8_952202b2f044
  7b2dbeba_4e87_c11b_857b_35a8ffc7d1fe["TestBindingYAMLFail()"]
  7b2dbeba_4e87_c11b_857b_35a8ffc7d1fe -->|calls| 209cb087_f0fd_de62_3ba8_952202b2f044
  aebd0564_565b_ba1b_7f92_4baaca0e7b7e["requestWithBody()"]
  209cb087_f0fd_de62_3ba8_952202b2f044 -->|calls| aebd0564_565b_ba1b_7f92_4baaca0e7b7e
  style 209cb087_f0fd_de62_3ba8_952202b2f044 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)
}

Subdomains

Frequently Asked Questions

What does testBodyBindingFail() do?
testBodyBindingFail() is a function in the gin codebase, defined in binding/binding_test.go.
Where is testBodyBindingFail() defined?
testBodyBindingFail() is defined in binding/binding_test.go at line 1328.
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