Stop useless panicking in context and render (#2150)

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Vladislav Dmitriyev
2023-02-12 05:01:33 +03:00
committed by GitHub
parent 153b229fcc
commit 0c96a20209
4 changed files with 16 additions and 19 deletions
+2 -5
View File
@@ -53,11 +53,8 @@ var (
)
// Render (JSON) writes data with custom ContentType.
func (r JSON) Render(w http.ResponseWriter) (err error) {
if err = WriteJSON(w, r.Data); err != nil {
panic(err)
}
return
func (r JSON) Render(w http.ResponseWriter) error {
return WriteJSON(w, r.Data)
}
// WriteContentType (JSON) writes JSON ContentType.