Skip to content

Commit

Permalink
Add pretty write
Browse files Browse the repository at this point in the history
  • Loading branch information
owenrumney committed Oct 27, 2020
1 parent c494769 commit 81ad3ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sarif/sarif.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,12 @@ func (sarif *Report) Write(w io.Writer) error {
_, err = w.Write(marshal)
return err
}

func (sarif *Report) PrettyWrite(w io.Writer) error {
marshal, err := json.MarshalIndent(sarif, "", " ")
if err != nil {
return err
}
_, err = w.Write(marshal)
return err
}

0 comments on commit 81ad3ed

Please sign in to comment.