From e9b68e923c9a545a5c336fff5c06c378ab623c02 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Mon, 30 Jun 2025 09:32:49 +0200 Subject: [PATCH] Returns error instead of printf Signed-off-by: Bryan Frimin --- pkg/probo/framework_service.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/probo/framework_service.go b/pkg/probo/framework_service.go index 8f248334a..6e914e88c 100644 --- a/pkg/probo/framework_service.go +++ b/pkg/probo/framework_service.go @@ -722,11 +722,9 @@ func (s FrameworkService) buildSOARowData(ctx context.Context, conn pg.Conn, con func (s FrameworkService) createSOAExcelFile(framework *coredata.Framework, soaData []soaRowData) (io.Reader, error) { f := excelize.NewFile() - defer func() { - if err := f.Close(); err != nil { - fmt.Printf("Error closing Excel file: %v\n", err) - } - }() + if err := f.Close(); err != nil { + return nil, fmt.Errorf("cannot close Excel file: %w", err) + } sheetName := "State of Applicability" f.SetSheetName("Sheet1", sheetName)