Skip to content

Commit 3259deb

Browse files
committed
tweak: minor codestyle fixes
1 parent 1672897 commit 3259deb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

formatter/formatter_excel.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import (
66
"github.com/xuri/excelize/v2"
77
)
88

9-
var EXCEL_COL_WIDTH float64 = 50
9+
// ExcelColWidth is the default width of the columns in the Excel file
10+
var ExcelColWidth float64 = 50
1011

1112
// ExcelFormatter is struct defined for Excel Output use-case
1213
type ExcelFormatter struct {
1314
config *Config
1415
}
1516

17+
// CellData is a struct to hold the data for a cell to avoid code duplication
1618
type CellData struct {
1719
sheetName string
1820
style int
@@ -147,7 +149,7 @@ func (f *ExcelFormatter) writeHeaders(cd *CellData) error {
147149
}
148150

149151
// Setting the width of the columns in order not to cut the text
150-
err = cd.file.SetColWidth(cd.sheetName, "A", "B", EXCEL_COL_WIDTH)
152+
err = cd.file.SetColWidth(cd.sheetName, "A", "B", ExcelColWidth)
151153
if err != nil {
152154
return err
153155
}

0 commit comments

Comments
 (0)