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

Function TestMappingIgnoreField

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

Source from the content-addressed store, hash-verified

95}
96
97func TestMappingIgnoreField(t *testing.T) {
98 var s struct {
99 A int `form:"A"`
100 B int `form:"-"`
101 }
102 err := mappingByPtr(&s, formSource{"A": {"9"}, "B": {"9"}}, "form")
103 require.NoError(t, err)
104
105 assert.Equal(t, 9, s.A)
106 assert.Equal(t, 0, s.B)
107}
108
109func TestMappingUnexportedField(t *testing.T) {
110 var s struct {

Callers

nothing calls this directly

Calls 1

mappingByPtrFunction · 0.85

Tested by

no test coverage detected