Before this change the FromCSVString would return a subset of rows in case csvReader.Read() returns an error but ignore the error itself.
E.g.
one, two, three
one, two, "error""
The second line will result in a ErrQuote but the error is not handled. Instead the first row and no error are returned. This will then lead to undesired behavior of tests relying on this data.
The method FromCSVString already runs into a panic if the number of columns do not match. Therefore, I propose that an invalid input should run into a panic as well.
All errors returned bycsvreader.Read, besides from io.EOF, should lead to a panic, as they indicate the csv string could not properly be parsed.
Before this change the
FromCSVString
would return a subset of rows in casecsvReader.Read()
returns an error but ignore the error itself. E.g.The second line will result in a
ErrQuote
but the error is not handled. Instead the first row and no error are returned. This will then lead to undesired behavior of tests relying on this data.The method
FromCSVString
already runs into a panic if the number of columns do not match. Therefore, I propose that an invalid input should run into a panic as well.All errors returned by
csvreader.Read
, besides fromio.EOF
, should lead to a panic, as they indicate the csv string could not properly be parsed.