mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 21:32:11 +08:00
Fixed json renderer
This commit is contained in:
parent
3dea0bc95b
commit
d0b7ad21ce
@ -54,8 +54,7 @@ var (
|
|||||||
|
|
||||||
// Render (JSON) writes data with custom ContentType.
|
// Render (JSON) writes data with custom ContentType.
|
||||||
func (r JSON) Render(w http.ResponseWriter) (err error) {
|
func (r JSON) Render(w http.ResponseWriter) (err error) {
|
||||||
r.WriteContentType(w)
|
return WriteJSON(w, r.Data)
|
||||||
return json.NewEncoder(w).Encode(r.Data)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteContentType (JSON) writes JSON ContentType.
|
// WriteContentType (JSON) writes JSON ContentType.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user