Skip to content

Commit

Permalink
[fix] update json formatting to indent the formatted output - closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
asciimoo committed Jun 3, 2020
1 parent f087795 commit 972781f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions formatter/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 972781f

Please sign in to comment.