gocarina / gocsv

The GoCSV package aims to provide easy CSV serialization and deserialization to the golang programming language
MIT License
1.95k stars 243 forks source link

Option to skip rows that fail to unmarshal #246

Open LukasDeco opened 1 year ago

LukasDeco commented 1 year ago

I noticed that when you have a custom type with custom converter using UnmarshalCSV, if it has an error, the Reader bails out from reading the rest of the rows, and they all become nil. Instead of bailing out, could we have an option where the reader will just return that row as nil but then continue on? So that way it doesn't nil-out valid rows. Let me know if that doesn't make sense.

LukasDeco commented 1 year ago

I would be interested in submitting an MR for this potentially.

DrBlury commented 1 year ago

@LukasDeco could you provide a PR/Fork that fixes this issue?