diff --git a/src/encoding/csv/reader.go b/src/encoding/csv/reader.go index df4702feded456..749f53260b1d0e 100644 --- a/src/encoding/csv/reader.go +++ b/src/encoding/csv/reader.go @@ -204,6 +204,11 @@ func (r *Reader) Read() (record []string, err error) { return record, err } +// CurrentNumLine returns the current line being read in the CSV file. +func (r Reader) CurrentNumLine() int { + return r.numLine +} + // FieldPos returns the line and column corresponding to // the start of the field with the given index in the slice most recently // returned by [Reader.Read]. Numbering of lines and columns starts at 1;