From 3c4efa7d48d8c08a863d37298f66afb99ddbb9bb Mon Sep 17 00:00:00 2001 From: marcosadsj Date: Sun, 9 Feb 2025 00:40:34 -0300 Subject: [PATCH] feat: add getter to current num line --- src/encoding/csv/reader.go | 5 +++++ 1 file changed, 5 insertions(+) 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;