Home / Function/ testBodyBindingUseNumber() — gin Function Reference

testBodyBindingUseNumber() — gin Function Reference

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

Function go DataBinding Mappers calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  02962a6d_041b_22da_35c7_6f582877df2c["testBodyBindingUseNumber()"]
  e3e8468e_5bf8_0c48_d297_45b6687777a8["TestBindingJSONUseNumber()"]
  e3e8468e_5bf8_0c48_d297_45b6687777a8 -->|calls| 02962a6d_041b_22da_35c7_6f582877df2c
  2899e942_a23d_574e_8d47_d28e895c2604["requestWithBody()"]
  02962a6d_041b_22da_35c7_6f582877df2c -->|calls| 2899e942_a23d_574e_8d47_d28e895c2604
  style 02962a6d_041b_22da_35c7_6f582877df2c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binding/binding_test.go lines 1272–1289

func testBodyBindingUseNumber(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 = true
	err := b.Bind(req, &obj)
	require.NoError(t, err)
	// we hope it is int64(123)
	v, e := obj.Foo.(json.Number).Int64()
	require.NoError(t, e)
	assert.Equal(t, int64(123), v)

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

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free