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

Method Bind

binding/form.go:24–35  ·  view source on GitHub ↗
(req *http.Request, obj any)

Source from the content-addressed store, hash-verified

22}
23
24func (formBinding) Bind(req *http.Request, obj any) error {
25 if err := req.ParseForm(); err != nil {
26 return err
27 }
28 if err := req.ParseMultipartForm(defaultMemory); err != nil && !errors.Is(err, http.ErrNotMultipart) {
29 return err
30 }
31 if err := mapForm(obj, req.Form); err != nil {
32 return err
33 }
34 return validate(obj)
35}
36
37func (formPostBinding) Name() string {
38 return "form-urlencoded"

Callers

nothing calls this directly

Calls 2

mapFormFunction · 0.85
validateFunction · 0.70

Tested by

no test coverage detected