SplitCSV silent return on error
morriswinkler-simple opened this issue · 1 comments
morriswinkler-simple commented
have a look at:
i propose
func SplitCSV(csvFilePath string, batchsize int) (batches []string) {
f, err := os.Open(csvFilePath)
if err != nil {
log.Fatal(err)
return
}
r := csv.NewReader(bufio.NewReader(f))
filedata, err := r.ReadAll()
if err != nil {
log.Fatal(err)
return
}
return splitFileIntoBatches(filedata, batchsize)
}