• Joe Tsai's avatar
    encoding/csv: add ParseError.RecordLine · 29ea82d0
    Joe Tsai authored
    CL 72150 fixes #22352 by reverting the problematic parts of that CL
    where the line number and column number were inconsistent with each other.
    This CL adds back functionality to address the issue that CL 72150
    was trying to solve in the first place. That is, it reports the starting
    line of the record, so that users have a frame of reference to start with
    when debugging what went wrong.
    
    In the event of gnarly CSV files with multiline quoted strings, a parse
    failure likely occurs somewhere between the start of the record and
    the point where the parser finally detected an error.
    Since ParserError.{Line,Column} reports where the *error* occurs, we
    add a RecordLine field to report where the record starts.
    
    Also take this time to cleanup and modernize TestRead.
    
    Fixes #19019
    Fixes #22352
    
    Change-Id: I16cebf0b81922c35f75804c7073e9cddbfd11a04
    Reviewed-on: https://go-review.googlesource.com/72310Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    29ea82d0
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...