Never indent JSON response

This commit is contained in:
Ingo Oppermann 2024-10-03 21:35:08 +02:00
parent 0a4118fa38
commit 30af9e9c36
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E

View File

@ -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)
}