File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -463,11 +463,17 @@ func output(t d4tls.TLSSession) {
463463 } else {
464464 panic (fmt .Sprintf ("./%s does not exist" , * outJSON ))
465465 }
466- // If not folder specidied , we output to stdout
466+ // If not folder specified , we output to stdout
467467 } else {
468- r := bytes .NewReader (jsonRecord )
469- _ , err := io .Copy (os .Stdout , r )
470- if err != nil {
468+ var buf bytes.Buffer
469+ if err := json .Compact (& buf , jsonRecord ); err != nil {
470+ fmt .Println ("Failed to compact json output" )
471+ }
472+ if _ , err := buf .Write ([]byte {0x0A }); err != nil {
473+ fmt .Println ("Could not append delimiter" )
474+ }
475+
476+ if _ , err := io .Copy (os .Stdout , & buf ); err != nil {
471477 panic ("Could not write to stdout." )
472478 }
473479 }
You can’t perform that action at this time.
0 commit comments