Skip to content

Commit

Permalink
fix: boolean expression always evaluates to true (#131)
Browse files Browse the repository at this point in the history
`reportPathVar` is confused with `reportPathFlagName`

I submit this contribution under the Apache-2.0 license.
  • Loading branch information
tcdsv authored Jul 6, 2023
1 parent 98a7f46 commit b138f5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func postRun(cmd *cobra.Command, args []string) {
// Show Report
if report.TotalItemsScanned > 0 {
report.ShowReport(stdoutFormatVar, cfg)
if len(reportPathFlagName) > 0 {
if len(reportPathVar) > 0 {
err := report.WriteFile(reportPathVar, cfg)
if err != nil {
log.Error().Msgf("Failed to create report file with error: %s", err)
Expand Down

0 comments on commit b138f5d

Please sign in to comment.