adding pretty print option

This commit is contained in:
zach rice committed 2019-11-12 18:18:51 -05:00
1 parent 315ee56024
commit c8f9560aa3
2 files changed
+10 -4

No files matched your search

+6 -1
View File
@@ -114,7 +114,12 @@ func (manager *Manager) receiveLeaks() {
for leak := range manager.leakChan {
manager.leaks = append(manager.leaks, leak)
if manager.Opts.Verbose {
b, _ := json.Marshal(leak)
var b []byte
if manager.Opts.PrettyPrint {
b, _ = json.MarshalIndent(leak, "", " ")
} else {
b, _ = json.Marshal(leak)
}
fmt.Println(string(b))
}
manager.leakWG.Done()