Home / Function/ testMsgPackBodyBinding() — gin Function Reference

testMsgPackBodyBinding() — gin Function Reference

Architecture documentation for the testMsgPackBodyBinding() function in binding_msgpack_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  9c00b76d_cf92_89e3_be45_a7ac2a4a1ced["testMsgPackBodyBinding()"]
  70da3a8e_4685_db81_c918_785137844e6a["binding_msgpack_test.go"]
  9c00b76d_cf92_89e3_be45_a7ac2a4a1ced -->|defined in| 70da3a8e_4685_db81_c918_785137844e6a
  1a7e9d30_90a8_6bf4_2037_7a02129ab087["TestBindingMsgPack()"]
  1a7e9d30_90a8_6bf4_2037_7a02129ab087 -->|calls| 9c00b76d_cf92_89e3_be45_a7ac2a4a1ced
  style 9c00b76d_cf92_89e3_be45_a7ac2a4a1ced fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binding/binding_msgpack_test.go lines 39–54

func testMsgPackBodyBinding(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)
	req.Header.Add("Content-Type", MIMEMSGPACK)
	err := b.Bind(req, &obj)
	require.NoError(t, err)
	assert.Equal(t, "bar", obj.Foo)

	obj = FooStruct{}
	req = requestWithBody(http.MethodPost, badPath, badBody)
	req.Header.Add("Content-Type", MIMEMSGPACK)
	err = MsgPack.Bind(req, &obj)
	require.Error(t, err)
}

Subdomains

Frequently Asked Questions

What does testMsgPackBodyBinding() do?
testMsgPackBodyBinding() is a function in the gin codebase, defined in binding/binding_msgpack_test.go.
Where is testMsgPackBodyBinding() defined?
testMsgPackBodyBinding() is defined in binding/binding_msgpack_test.go at line 39.
What calls testMsgPackBodyBinding()?
testMsgPackBodyBinding() is called by 1 function(s): TestBindingMsgPack.

Analyze Your Own Codebase

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

Try Supermodel Free