Skip to content

Commit

Permalink
fix(report): wrong pdf data type assertion during generation (#3681)
Browse files Browse the repository at this point in the history
Signed-off-by: Rogério Peixoto <[email protected]>
  • Loading branch information
rogeriopeixotocx authored Jun 16, 2021
1 parent 38e78ef commit 5174a8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/report/pdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func PrintPdfReport(path, filename string, body interface{}) error {
startTime := time.Now()
log.Info().Msg("Started generating pdf report")

summary := body.(model.Summary)
summary := body.(*model.Summary)
basePath, err := os.Getwd()
if err != nil {
return err
Expand All @@ -196,7 +196,7 @@ func PrintPdfReport(path, filename string, body interface{}) error {

m.SetBackgroundColor(color.NewWhite())

createFirstPageHeader(m, &summary)
createFirstPageHeader(m, summary)

m.Line(1.0)

Expand Down
2 changes: 1 addition & 1 deletion pkg/report/pdf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestPrintPdfReport(t *testing.T) {
if err := os.MkdirAll(test.caseTest.path, os.ModePerm); err != nil {
t.Fatal(err)
}
err := PrintPdfReport(test.caseTest.path, test.caseTest.filename, test.caseTest.summary)
err := PrintPdfReport(test.caseTest.path, test.caseTest.filename, &test.caseTest.summary)
checkFileExists(t, err, &test, "pdf")
os.RemoveAll(test.caseTest.path)
})
Expand Down

0 comments on commit 5174a8b

Please sign in to comment.