Пример #1
0
func (c *Context) Render(code int, r render.Render) {
	c.writermem.WriteHeader(code)
	if err := r.Write(c.Writer); err != nil {
		debugPrintError(err)
		c.AbortWithError(500, err).SetType(ErrorTypeRender)
	}
}
Пример #2
0
func (c *Context) Render(code int, render render.Render, obj ...interface{}) {
	if err := render.Render(c.Writer, code, obj...); err != nil {
		c.ErrorTyped(err, ErrorTypeInternal, obj)
		c.Abort(500)
	}
}
Пример #3
0
func (c *Context) Render(code int, r render.Render) {
	c.Status(code)
	if err := r.Render(c.Writer); err != nil {
		panic(err)
	}
}
Пример #4
0
func (c *Context) Render(code int, r render.Render) {
	c.writermem.WriteHeader(code)
	if err := r.Render(c.Writer); err != nil {
		c.renderError(err)
	}
}