From 482e5deb6e7cf2ed4ee4322016c4e16cf3f6e31a Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Wed, 31 May 2023 10:38:55 +1000 Subject: [PATCH] updated logging --- cmd/main/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/main/main.go b/cmd/main/main.go index 0e6f9ef..9d01039 100644 --- a/cmd/main/main.go +++ b/cmd/main/main.go @@ -85,6 +85,10 @@ func main() { // Assume that our content is within the first top-level key topLevel := o.Keys() + fmt.Printf("Found %d top-level keys in json data\n", len(topLevel)) + for i, key := range topLevel { + fmt.Printf("[%d] : %s\n", i, key) + } // Check for config embedded in json if strings.EqualFold(topLevel[0], configNode) && len(topLevel) > 1 { @@ -398,13 +402,12 @@ func modifyWorkbook(worksheetName string, outputFilename string) *excelize.File } func createHeadingRow(xlsx *excelize.File, worksheetName string, columnNames []string) { - fmt.Printf("Creating excel workbook with following headings : '%v'\n", columnNames) var cell string row := 1 column := 1 if len(config.keyOrder) > 0 { - fmt.Printf("Setting heading order as per config key-order\n") + fmt.Printf("Creating excel workbook with heading order as per config key-order\n") // Check that the number of specified columns matches input data if len(config.keyOrder) != len(columnNames) { error := fmt.Sprintf("Column order specified in json key-order but mismatch found in json data. %d specifed columns does not match %d found columns.", len(config.keyOrder), len(columnNames)) @@ -419,6 +422,7 @@ func createHeadingRow(xlsx *excelize.File, worksheetName string, columnNames []s column++ } } else { + fmt.Printf("Creating excel workbook with following headings : '%v'\n", columnNames) // Add the header row for i := 0; i < len(columnNames); i++ { cell, _ = excelize.CoordinatesToCellName(column, row)