aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/datamaps/reader.go
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-07-27 21:48:04 +0100
committerMatthew Lemon <matt@matthewlemon.com>2020-07-27 21:48:04 +0100
commit76e347271d4ce0e611389839253e3ac5cc50822e (patch)
tree7763c21305c00aec0dd9bb5d0000ef85b9058c9d /pkg/datamaps/reader.go
parent6432f9a7465453bc2efa11b736e19d58a0503e43 (diff)
fixing a bug in ExtractDBDatamap and still working on data import code
Diffstat (limited to 'pkg/datamaps/reader.go')
-rw-r--r--pkg/datamaps/reader.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/datamaps/reader.go b/pkg/datamaps/reader.go
index d706d8f..4f5e1a0 100644
--- a/pkg/datamaps/reader.go
+++ b/pkg/datamaps/reader.go
@@ -200,10 +200,16 @@ func ExtractDBDatamap(name string, file string, db *sql.DB) (extractedData, erro
names := getSheetNames(ddata)
outer := make(extractedData, len(names))
- inner := make(map[string]xlsx.Cell)
+ var inner map[string]xlsx.Cell
+
+ seen := make(map[string]bool)
for _, i := range ddata {
sheet := i.Sheet
+ if !seen[sheet] {
+ seen[sheet] = true
+ inner = make(map[string]xlsx.Cell)
+ }
cellref := i.Cellref
if val, ok := xdata[sheet][cellref]; ok {