TestMappingUsingBindUnmarshalerAndTextUnmarshalerWhenOnlyTextUnmarshalerDefined() — gin Function Reference
Architecture documentation for the TestMappingUsingBindUnmarshalerAndTextUnmarshalerWhenOnlyTextUnmarshalerDefined() function in form_mapping_test.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD e5ed14b4_c890_35bf_3a94_f811beb99e56["TestMappingUsingBindUnmarshalerAndTextUnmarshalerWhenOnlyTextUnmarshalerDefined()"] 36de44f8_6a8c_78ab_4c20_59952e276c82["form_mapping_test.go"] e5ed14b4_c890_35bf_3a94_f811beb99e56 -->|defined in| 36de44f8_6a8c_78ab_4c20_59952e276c82 style e5ed14b4_c890_35bf_3a94_f811beb99e56 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
binding/form_mapping_test.go lines 1022–1035
func TestMappingUsingBindUnmarshalerAndTextUnmarshalerWhenOnlyTextUnmarshalerDefined(t *testing.T) {
var s struct {
Hex customUnmarshalTextHex `form:"hex"`
HexByUnmarshalText customUnmarshalTextHex `form:"hex2,parser=encoding.TextUnmarshaler"`
}
err := mappingByPtr(&s, formSource{
"hex": {`11`},
"hex2": {`11`},
}, "form")
require.NoError(t, err)
assert.EqualValues(t, 11, s.Hex) // this is using default int binding, not our custom hex binding. 0x11 should be 17 in decimal
assert.EqualValues(t, 0x11, s.HexByUnmarshalText) // correct expected value for normal hex binding
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does TestMappingUsingBindUnmarshalerAndTextUnmarshalerWhenOnlyTextUnmarshalerDefined() do?
TestMappingUsingBindUnmarshalerAndTextUnmarshalerWhenOnlyTextUnmarshalerDefined() is a function in the gin codebase, defined in binding/form_mapping_test.go.
Where is TestMappingUsingBindUnmarshalerAndTextUnmarshalerWhenOnlyTextUnmarshalerDefined() defined?
TestMappingUsingBindUnmarshalerAndTextUnmarshalerWhenOnlyTextUnmarshalerDefined() is defined in binding/form_mapping_test.go at line 1022.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free