Home / Function/ TestMappingFormWithEmptyToDefault() — gin Function Reference

TestMappingFormWithEmptyToDefault() — gin Function Reference

Architecture documentation for the TestMappingFormWithEmptyToDefault() function in form_mapping_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  fced30d9_aa99_5e11_ac6b_11df9fba36e4["TestMappingFormWithEmptyToDefault()"]
  36de44f8_6a8c_78ab_4c20_59952e276c82["form_mapping_test.go"]
  fced30d9_aa99_5e11_ac6b_11df9fba36e4 -->|defined in| 36de44f8_6a8c_78ab_4c20_59952e276c82
  style fced30d9_aa99_5e11_ac6b_11df9fba36e4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binding/form_mapping_test.go lines 167–174

func TestMappingFormWithEmptyToDefault(t *testing.T) {
	var s struct {
		F string `form:"field,default=DefVal"`
	}
	err := mapForm(&s, map[string][]string{"field": {""}})
	require.NoError(t, err)
	assert.Equal(t, "DefVal", s.F)
}

Subdomains

Frequently Asked Questions

What does TestMappingFormWithEmptyToDefault() do?
TestMappingFormWithEmptyToDefault() is a function in the gin codebase, defined in binding/form_mapping_test.go.
Where is TestMappingFormWithEmptyToDefault() defined?
TestMappingFormWithEmptyToDefault() is defined in binding/form_mapping_test.go at line 167.

Analyze Your Own Codebase

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

Try Supermodel Free