From 5fb29cb7726997b6f5ec2f17d3ab91f8db6c4888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20=C3=81lvarez?= Date: Tue, 10 Apr 2018 12:19:50 +0800 Subject: [PATCH] Amend a very minor typo in a variable name --- context/output.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/context/output.go b/context/output.go index 61ce8cc7..820b1a88 100644 --- a/context/output.go +++ b/context/output.go @@ -182,8 +182,8 @@ func errorRenderer(err error) Renderer { } // JSON writes json to response body. -// if coding is true, it converts utf-8 to \u0000 type. -func (output *BeegoOutput) JSON(data interface{}, hasIndent bool, coding bool) error { +// if encoding is true, it converts utf-8 to \u0000 type. +func (output *BeegoOutput) JSON(data interface{}, hasIndent bool, encoding bool) error { output.Header("Content-Type", "application/json; charset=utf-8") var content []byte var err error @@ -196,7 +196,7 @@ func (output *BeegoOutput) JSON(data interface{}, hasIndent bool, coding bool) e http.Error(output.Context.ResponseWriter, err.Error(), http.StatusInternalServerError) return err } - if coding { + if encoding { content = []byte(stringsToJSON(string(content))) } return output.Body(content)