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

Function TestValidationDisabled

binding/binding_test.go:757–766  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

755}
756
757func TestValidationDisabled(t *testing.T) {
758 backup := Validator
759 Validator = nil
760 defer func() { Validator = backup }()
761
762 var obj FooStruct
763 req := requestWithBody(http.MethodPost, "/", `{"bar": "foo"}`)
764 err := JSON.Bind(req, &obj)
765 require.NoError(t, err)
766}
767
768func TestRequiredSucceeds(t *testing.T) {
769 type HogeStruct struct {

Callers

nothing calls this directly

Calls 2

requestWithBodyFunction · 0.85
BindMethod · 0.65

Tested by

no test coverage detected