diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-08-02 15:32:42 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-08-02 15:32:42 +0100 |
commit | cbb3eb9fe49d36f8a48f8059de783da15472e289 (patch) | |
tree | a598f3bcb05035dc66e4e9c620fc12134c65bcfc | |
parent | 6a0bfa3a8da617bd416c011599fca1d832b67e2a (diff) |
fixed issue with not writing header to master - needed to AddRowAtIndex()
-rw-r--r-- | pkg/datamaps/writer.go | 4 |
1 files 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 |