diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2019-11-01 16:48:28 +0000 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2019-11-01 16:48:28 +0000 |
commit | 060508970a81bbc047f8aea975a5ce1744fb0046 (patch) | |
tree | 7fc27643db0588079ebcd238238d6144ece6d439 /reader/reader.go | |
parent | 03073b44eaa801afc2faad7175669c2ee377838d (diff) |
removed the pointer
Diffstat (limited to 'reader/reader.go')
-rw-r--r-- | reader/reader.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/reader/reader.go b/reader/reader.go index 33e1773..e9eabac 100644 --- a/reader/reader.go +++ b/reader/reader.go @@ -32,12 +32,12 @@ func Keylens(dml DatamapLine) (int, int) { return len(dml.Key), len(dml.Sheet) } -//ReadDML returns a pointer to a slice of DatamapLine structs -func ReadDML(path string) (*[]DatamapLine, error) { +//ReadDML returns a slice of DatamapLine structs +func ReadDML(path string) ([]DatamapLine, error) { var s []DatamapLine data, err := ioutil.ReadFile(path) if err != nil { - return &s, errors.New("Cannot find file") + return s, errors.New("Cannot find file") } r := csv.NewReader(strings.NewReader(string(data))) for { @@ -46,7 +46,7 @@ func ReadDML(path string) (*[]DatamapLine, error) { break } if err != nil { - return &s, errors.New("Cannot read line %s") + return s, errors.New("Cannot read line %s") } if record[0] == "cell_key" { // this must be the header @@ -58,7 +58,7 @@ func ReadDML(path string) (*[]DatamapLine, error) { Cellref: strings.Trim(record[2], " ")} s = append(s, dml) } - return &s, nil + return s, nil } //ReadXLSX reads an XLSX file |