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

Method Render

render/bson.go:21–29  ·  view source on GitHub ↗

Render (BSON) marshals the given interface object and writes data with custom ContentType.

(w http.ResponseWriter)

Source from the content-addressed store, hash-verified

19
20// Render (BSON) marshals the given interface object and writes data with custom ContentType.
21func (r BSON) Render(w http.ResponseWriter) error {
22 r.WriteContentType(w)
23
24 bytes, err := bson.Marshal(&r.Data)
25 if err == nil {
26 _, err = w.Write(bytes)
27 }
28 return err
29}
30
31// WriteContentType (BSONBuf) writes BSONBuf ContentType.
32func (r BSON) WriteContentType(w http.ResponseWriter) {

Callers

nothing calls this directly

Calls 3

WriteContentTypeMethod · 0.95
MarshalMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected