@@ -322,18 +322,31 @@ func (r *Review) GetAnalysesNotes() ([]analyses.Note, error) {
322
322
return analysesNotes , nil
323
323
}
324
324
325
- // GetJson returns the pretty printed JSON for a review.
326
- func (r * Review ) GetJson () (string , error ) {
325
+ func prettyPrintJson (jsonBytes []byte ) (string , error ) {
326
+ var prettyBytes bytes.Buffer
327
+ err := json .Indent (& prettyBytes , jsonBytes , "" , " " )
328
+ if err != nil {
329
+ return "" , err
330
+ }
331
+ return prettyBytes .String (), nil
332
+ }
333
+
334
+ // GetJson returns the pretty printed JSON for a review summary.
335
+ func (r * ReviewSummary ) GetJson () (string , error ) {
327
336
jsonBytes , err := json .Marshal (* r )
328
337
if err != nil {
329
338
return "" , err
330
339
}
331
- var prettyBytes bytes.Buffer
332
- err = json .Indent (& prettyBytes , jsonBytes , "" , " " )
340
+ return prettyPrintJson (jsonBytes )
341
+ }
342
+
343
+ // GetJson returns the pretty printed JSON for a review.
344
+ func (r * Review ) GetJson () (string , error ) {
345
+ jsonBytes , err := json .Marshal (* r )
333
346
if err != nil {
334
347
return "" , err
335
348
}
336
- return prettyBytes . String (), nil
349
+ return prettyPrintJson ( jsonBytes )
337
350
}
338
351
339
352
// findLastCommit returns the later (newest) commit from the union of the provided commit
0 commit comments