From 3d99bbe3c7aa8b149330294e682b26eacb45c22b Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Wed, 21 Feb 2024 21:37:38 +0530 Subject: [PATCH] feat: improve code Signed-off-by: Shubham Gupta --- pkg/report/report.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/report/report.go b/pkg/report/report.go index 12b775bec..389cfa482 100644 --- a/pkg/report/report.go +++ b/pkg/report/report.go @@ -139,9 +139,9 @@ func (report *TestsReport) SaveReportBasedOnType(reportFormat v1alpha1.ReportFor if filepath.Ext(reportName) == "" { reportName += "." + strings.ToLower(string(reportFormat)) } - filePath := filepath.Join(reportPath, reportName) - if reportPath == "" { - filePath = reportName + filePath := reportName + if reportPath != "" { + filePath = filepath.Join(reportPath, reportName) } return SaveReport(report, serializer, filePath) }