Home / Function/ testProtoBodyBinding() — gin Function Reference

testProtoBodyBinding() — gin Function Reference

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

Function go DataBinding Mappers calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  0bc9d1e1_04ae_f166_db1b_dceb3434413f["testProtoBodyBinding()"]
  e3069ac6_d11a_4696_6cd0_400e19a67048["TestBindingProtoBuf()"]
  e3069ac6_d11a_4696_6cd0_400e19a67048 -->|calls| 0bc9d1e1_04ae_f166_db1b_dceb3434413f
  2899e942_a23d_574e_8d47_d28e895c2604["requestWithBody()"]
  0bc9d1e1_04ae_f166_db1b_dceb3434413f -->|calls| 2899e942_a23d_574e_8d47_d28e895c2604
  style 0bc9d1e1_04ae_f166_db1b_dceb3434413f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binding/binding_test.go lines 1343–1358

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

	obj := protoexample.Test{}
	req := requestWithBody(http.MethodPost, path, body)
	req.Header.Add("Content-Type", MIMEPROTOBUF)
	err := b.Bind(req, &obj)
	require.NoError(t, err)
	assert.Equal(t, "yes", *obj.Label)

	obj = protoexample.Test{}
	req = requestWithBody(http.MethodPost, badPath, badBody)
	req.Header.Add("Content-Type", MIMEPROTOBUF)
	err = ProtoBuf.Bind(req, &obj)
	require.Error(t, err)
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free