diff --git a/binding/form_mapping_test.go b/binding/form_mapping_test.go index b3fc37527f..8cf7465173 100644 --- a/binding/form_mapping_test.go +++ b/binding/form_mapping_test.go @@ -154,6 +154,15 @@ func TestMappingForm(t *testing.T) { assert.Equal(t, 6, s.F) } +func TestMappingFormFieldNotSent(t *testing.T) { + var s struct { + F string `form:"field,default=defVal"` + } + err := mapForm(&s, map[string][]string{}) + require.NoError(t, err) + assert.Equal(t, "defVal", s.F) +} + func TestMappingFormWithEmptyToDefault(t *testing.T) { var s struct { F string `form:"field,default=DefVal"`