MCPcopy
hub / github.com/gin-gonic/gin / TestMappingFormFieldNotSent

Function TestMappingFormFieldNotSent

binding/form_mapping_test.go:158–165  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

156}
157
158func TestMappingFormFieldNotSent(t *testing.T) {
159 var s struct {
160 F string `form:"field,default=defVal"`
161 }
162 err := mapForm(&s, map[string][]string{})
163 require.NoError(t, err)
164 assert.Equal(t, "defVal", s.F)
165}
166
167func TestMappingFormWithEmptyToDefault(t *testing.T) {
168 var s struct {

Callers

nothing calls this directly

Calls 1

mapFormFunction · 0.85

Tested by

no test coverage detected