TestBindingFormStringSliceMap() — gin Function Reference
Architecture documentation for the TestBindingFormStringSliceMap() function in binding_test.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD a1d25d7f_2a8f_f212_7d42_14718f6a07d3["TestBindingFormStringSliceMap()"] 2899e942_a23d_574e_8d47_d28e895c2604["requestWithBody()"] a1d25d7f_2a8f_f212_7d42_14718f6a07d3 -->|calls| 2899e942_a23d_574e_8d47_d28e895c2604 style a1d25d7f_2a8f_f212_7d42_14718f6a07d3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
binding/binding_test.go lines 381–400
func TestBindingFormStringSliceMap(t *testing.T) {
obj := make(map[string][]string)
req := requestWithBody(http.MethodPost, "/", "foo=something&foo=bar&hello=world")
req.Header.Add("Content-Type", MIMEPOSTForm)
err := Form.Bind(req, &obj)
require.NoError(t, err)
assert.NotNil(t, obj)
assert.Len(t, obj, 2)
target := map[string][]string{
"foo": {"something", "bar"},
"hello": {"world"},
}
assert.True(t, reflect.DeepEqual(obj, target))
objInvalid := make(map[string][]int)
req = requestWithBody(http.MethodPost, "/", "foo=something&foo=bar&hello=world")
req.Header.Add("Content-Type", MIMEPOSTForm)
err = Form.Bind(req, &objInvalid)
require.Error(t, err)
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does TestBindingFormStringSliceMap() do?
TestBindingFormStringSliceMap() is a function in the gin codebase.
What does TestBindingFormStringSliceMap() call?
TestBindingFormStringSliceMap() calls 1 function(s): requestWithBody.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free