aboutsummaryrefslogtreecommitdiffstats
path: root/reader/reader.go
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2019-11-01 16:48:28 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2019-11-01 16:48:28 +0000
commit060508970a81bbc047f8aea975a5ce1744fb0046 (patch)
tree7fc27643db0588079ebcd238238d6144ece6d439 /reader/reader.go
parent03073b44eaa801afc2faad7175669c2ee377838d (diff)
removed the pointer
Diffstat (limited to 'reader/reader.go')
-rw-r--r--reader/reader.go10
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