mirror of
https://github.com/gin-gonic/gin.git
synced 2025-08-06 15:50:30 +08:00
Faster IndentedJSON + unit tests
This commit is contained in:
@ -329,7 +329,9 @@ func (c *Context) HTML(code int, name string, obj interface{}) {
|
||||
}
|
||||
|
||||
func (c *Context) IndentedJSON(code int, obj interface{}) {
|
||||
c.Render(code, render.IndentedJSON, obj)
|
||||
if err := render.WriteIndentedJSON(c.Writer, code, obj); err != nil {
|
||||
c.renderingError(err, obj)
|
||||
}
|
||||
}
|
||||
|
||||
// Serializes the given struct as JSON into the response body in a fast and efficient way.
|
||||
|
Reference in New Issue
Block a user