From 30af9e9c3640007810eb9f7765169e5995761c46 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 3 Oct 2024 21:35:08 +0200 Subject: [PATCH] Never indent JSON response --- http/json.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/http/json.go b/http/json.go index 83367a4a..fd2c1205 100644 --- a/http/json.go +++ b/http/json.go @@ -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) }