Skip to content

Commit

Permalink
Merge c618286 into 75cd5b2
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krivak committed Oct 12, 2019
2 parents 75cd5b2 + c618286 commit 5c37296
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ const jsonFileName string = "report.json"
const htmlReportDir string = "talisman_html_report"

// GenerateReport generates a talisman scan report in html format
func GenerateReport(r *detector.DetectionResults, directory string) (string, error) {
func GenerateReport(r *detector.DetectionResults, directory string) (path string, err error) {

var path string
var jsonFilePath string
var homeDir string
var baseReportDirPath string
Expand Down Expand Up @@ -51,8 +50,9 @@ func GenerateReport(r *detector.DetectionResults, directory string) (string, err

jsonFile, err := os.Create(jsonFilePath)
defer func() {
err = jsonFile.Close()
log.Fatalf("error closing file %s: %v", jsonFilePath, err)
if err = jsonFile.Close(); err != nil {
err = fmt.Errorf("error closing file %s: %v", jsonFilePath, err)
}
}()

if err != nil {
Expand Down

0 comments on commit 5c37296

Please sign in to comment.