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

Method Bind

binding/json.go:33–38  ·  view source on GitHub ↗
(req *http.Request, obj any)

Source from the content-addressed store, hash-verified

31}
32
33func (jsonBinding) Bind(req *http.Request, obj any) error {
34 if req == nil || req.Body == nil {
35 return errors.New("invalid request")
36 }
37 return decodeJSON(req.Body, obj)
38}
39
40func (jsonBinding) BindBody(body []byte, obj any) error {
41 return decodeJSON(bytes.NewReader(body), obj)

Callers

nothing calls this directly

Calls 1

decodeJSONFunction · 0.85

Tested by

no test coverage detected