decodeIn use the content type to decode the data from r into t (which should be a pointer).
(t any, r io.Reader, contentType string, options *RouteOptions)
| 135 | |
| 136 | // decodeIn use the content type to decode the data from r into t (which should be a pointer). |
| 137 | func decodeIn(t any, r io.Reader, contentType string, options *RouteOptions) (any, error) { |
| 138 | decoder, err := encoding.ContentTypeDecoder(r, contentType, options.codecs) |
| 139 | if err != nil { |
| 140 | return t, err |
| 141 | } |
| 142 | |
| 143 | err = decoder.Decode(t) |
| 144 | return t, err |
| 145 | } |
| 146 | |
| 147 | // TODO: is it used? Delete? |
| 148 | func updateFieldInEntity[Ent any](entity Ent, fieldName string, fieldValue any) (err error) { |
nothing calls this directly
no test coverage detected