diff options
Diffstat (limited to '')
-rw-r--r-- | pkg/datamaps/reader.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/pkg/datamaps/reader.go b/pkg/datamaps/reader.go index 4490d23..1b9a471 100644 --- a/pkg/datamaps/reader.go +++ b/pkg/datamaps/reader.go @@ -200,21 +200,18 @@ func ExtractDBDatamap(name string, file string, db *sql.DB) (extractedData, erro names := getSheetNames(ddata) outer := make(extractedData, len(names)) - var inner map[string]xlsx.Cell + // var inner map[string]xlsx.Cell - seen := make(map[string]bool) // using this as a set to distinguish sheet names + for _, s := range names { + outer[s] = make(map[string]xlsx.Cell) + } for _, i := range ddata { sheet := i.Sheet - if !seen[sheet] { - seen[sheet] = true - inner = make(map[string]xlsx.Cell) // we create a new inner when we get a new sheet - } cellref := i.Cellref if val, ok := xdata[sheet][cellref]; ok { - inner[cellref] = *val.Cell - outer[sheet] = inner + outer[sheet][cellref] = *val.Cell } } |