diff options
-rw-r--r-- | pkg/datamaps/db.go | 2 | ||||
-rw-r--r-- | pkg/datamaps/reader.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pkg/datamaps/db.go b/pkg/datamaps/db.go index 0b6f588..fb1785f 100644 --- a/pkg/datamaps/db.go +++ b/pkg/datamaps/db.go @@ -214,7 +214,7 @@ func importXLSXtoDB(dm_name string, return_name string, file string, db *sql.DB) var dmlId *int if err := dmlIdRow.Scan(&dmlId); err != nil { - log.Fatal(err) + fmt.Errorf("cannot find a datamap_line row for %s and %s: %s\n", sheetName, cellRef, err) } insertStmt, err := db.Prepare("insert into return_data (dml_id, value) values(?,?)") diff --git a/pkg/datamaps/reader.go b/pkg/datamaps/reader.go index 4f5e1a0..4490d23 100644 --- a/pkg/datamaps/reader.go +++ b/pkg/datamaps/reader.go @@ -202,13 +202,13 @@ func ExtractDBDatamap(name string, file string, db *sql.DB) (extractedData, erro outer := make(extractedData, len(names)) var inner map[string]xlsx.Cell - seen := make(map[string]bool) + seen := make(map[string]bool) // using this as a set to distinguish sheet names for _, i := range ddata { sheet := i.Sheet if !seen[sheet] { seen[sheet] = true - inner = make(map[string]xlsx.Cell) + inner = make(map[string]xlsx.Cell) // we create a new inner when we get a new sheet } cellref := i.Cellref |