From cbb3eb9fe49d36f8a48f8059de783da15472e289 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 2 Aug 2020 15:32:42 +0100 Subject: fixed issue with not writing header to master - needed to AddRowAtIndex() --- pkg/datamaps/writer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/datamaps/writer.go b/pkg/datamaps/writer.go index 5a2507a..b461e94 100644 --- a/pkg/datamaps/writer.go +++ b/pkg/datamaps/writer.go @@ -114,12 +114,12 @@ func ExportMaster(opts *Options) error { for masterRow := 0; masterRow < len(datamapKeys); masterRow++ { log.Printf("Writing to masterRow which is %d", masterRow) - r, err := sh.Row(masterRow) + r, err := sh.AddRowAtIndex(masterRow) if err != nil { return fmt.Errorf("cannot create row %d in output spreadsheet: %v", masterRow, err) } if masterRow == 0 { - if hdr := r.WriteSlice(headerSlice, -1); hdr == -1 { + if hdr := r.WriteSlice(append([]string{""}, headerSlice...), -1); hdr == -1 { return fmt.Errorf("cannot write header values into header row: %v", err) } continue -- cgit v1.2.3