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
  5f71fa77_a184_190d_b163_8d11fc6e5529["testMsgPackBodyBinding()"]
  4c69a15d_2417_26dc_5154_5f46e2f72360["TestBindingMsgPack()"]
  4c69a15d_2417_26dc_5154_5f46e2f72360 -->|calls| 5f71fa77_a184_190d_b163_8d11fc6e5529
  style 5f71fa77_a184_190d_b163_8d11fc6e5529 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)
}

Domain

Subdomains

Frequently Asked Questions

What does testMsgPackBodyBinding() do?
testMsgPackBodyBinding() is a function in the gin codebase.
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