TestMappingArray() — gin Function Reference
Architecture documentation for the TestMappingArray() function in form_mapping_test.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD 881d15f2_b343_0d51_af49_b8fc10ea0f1d["TestMappingArray()"] 36de44f8_6a8c_78ab_4c20_59952e276c82["form_mapping_test.go"] 881d15f2_b343_0d51_af49_b8fc10ea0f1d -->|defined in| 36de44f8_6a8c_78ab_4c20_59952e276c82 style 881d15f2_b343_0d51_af49_b8fc10ea0f1d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
binding/form_mapping_test.go lines 304–325
func TestMappingArray(t *testing.T) {
var s struct {
Array [2]int `form:"array,default=9"`
}
// wrong default
err := mappingByPtr(&s, formSource{}, "form")
require.Error(t, err)
// ok
err = mappingByPtr(&s, formSource{"array": {"3", "4"}}, "form")
require.NoError(t, err)
assert.Equal(t, [2]int{3, 4}, s.Array)
// error - not enough vals
err = mappingByPtr(&s, formSource{"array": {"3"}}, "form")
require.Error(t, err)
// error - wrong value
err = mappingByPtr(&s, formSource{"array": {"wrong"}}, "form")
require.Error(t, err)
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does TestMappingArray() do?
TestMappingArray() is a function in the gin codebase, defined in binding/form_mapping_test.go.
Where is TestMappingArray() defined?
TestMappingArray() is defined in binding/form_mapping_test.go at line 304.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free