Home / Function/ testBodyBindingUseNumber2() — gin Function Reference

testBodyBindingUseNumber2() — gin Function Reference

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

Function go DataBinding Mappers calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  0cf6b8e6_af5f_334b_b8b1_7d9a151cf34e["testBodyBindingUseNumber2()"]
  3ce08e59_0176_f04d_d7d8_fd1c19537397["TestBindingJSONUseNumber2()"]
  3ce08e59_0176_f04d_d7d8_fd1c19537397 -->|calls| 0cf6b8e6_af5f_334b_b8b1_7d9a151cf34e
  2899e942_a23d_574e_8d47_d28e895c2604["requestWithBody()"]
  0cf6b8e6_af5f_334b_b8b1_7d9a151cf34e -->|calls| 2899e942_a23d_574e_8d47_d28e895c2604
  style 0cf6b8e6_af5f_334b_b8b1_7d9a151cf34e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binding/binding_test.go lines 1291–1307

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

	obj := FooStructUseNumber{}
	req := requestWithBody(http.MethodPost, path, body)
	EnableDecoderUseNumber = false
	err := b.Bind(req, &obj)
	require.NoError(t, err)
	// it will return float64(123) if not use EnableDecoderUseNumber
	// maybe it is not hoped
	assert.InDelta(t, float64(123), obj.Foo, 0.01)

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

Domain

Subdomains

Frequently Asked Questions

What does testBodyBindingUseNumber2() do?
testBodyBindingUseNumber2() is a function in the gin codebase.
What does testBodyBindingUseNumber2() call?
testBodyBindingUseNumber2() calls 1 function(s): requestWithBody.
What calls testBodyBindingUseNumber2()?
testBodyBindingUseNumber2() is called by 1 function(s): TestBindingJSONUseNumber2.

Analyze Your Own Codebase

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

Try Supermodel Free