ForceCLI/force

SplitCSV silent return on error

morriswinkler-simple opened this issue · 1 comments

have a look at:

https://github.com/heroku/force/blob/b95cf1de07a6d0627446cfcac9dbcd9af8996007/command/bulk.go#L512-L524

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)
}

Thanks for the report, @morriswinkler-simplesurance. I've opened #455 to handle errors parsing the csv input.