From 972781f2ba353002cab3be0379adc5c89e821cb0 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 3 Jun 2020 17:28:32 +0200 Subject: [PATCH] [fix] update json formatting to indent the formatted output - closes #130 --- formatter/json.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/formatter/json.go b/formatter/json.go index ce8441e..3c8fb18 100644 --- a/formatter/json.go +++ b/formatter/json.go @@ -16,6 +16,7 @@ type jsonFormatter struct { func (f *jsonFormatter) Format(writer io.Writer, data []byte) error { jsonFormatter := jsoncolor.NewFormatter() + jsonFormatter.Indent = " " buf := bytes.NewBuffer(make([]byte, 0, len(data))) err := jsonFormatter.Format(buf, data) if err == nil { @@ -44,6 +45,7 @@ func (f *jsonFormatter) Search(q string, body []byte) ([]string, error) { body = []byte(searchResult.String()) } jsonFormatter := jsoncolor.NewFormatter() + jsonFormatter.Indent = " " buf := bytes.NewBuffer(make([]byte, 0, len(body))) err := jsonFormatter.Format(buf, body) if err != nil {