Never indent JSON response
This commit is contained in:
parent
0a4118fa38
commit
30af9e9c36
@ -14,11 +14,8 @@ type GoJSONSerializer struct{}
|
||||
|
||||
// Serialize converts an interface into a json and writes it to the response.
|
||||
// You can optionally use the indent parameter to produce pretty JSONs.
|
||||
func (d GoJSONSerializer) Serialize(c echo.Context, i interface{}, indent string) error {
|
||||
func (d GoJSONSerializer) Serialize(c echo.Context, i interface{}, _ string) error {
|
||||
enc := json.NewEncoder(c.Response())
|
||||
if indent != "" {
|
||||
enc.SetIndent("", indent)
|
||||
}
|
||||
return enc.Encode(i)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user