From 55740c471c84e9c4a482e6c141bf19bdeae9675a Mon Sep 17 00:00:00 2001 From: John Kerl Date: Sun, 9 Mar 2025 14:48:08 -0400 Subject: [PATCH] iterating --- pkg/input/record_reader_xtab.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/input/record_reader_xtab.go b/pkg/input/record_reader_xtab.go index 4de56442a..94f342b65 100644 --- a/pkg/input/record_reader_xtab.go +++ b/pkg/input/record_reader_xtab.go @@ -231,7 +231,7 @@ func channelizedStanzaScanner( // TODO: comment copiously we're trying to handle slow/fast/short/long reads: tail -f, smallfile, bigfile. func (reader *RecordReaderXTAB) getRecordBatch( - stanzasChannel chan<- *types.List[*tStanza], + stanzasChannel <-chan *types.List[*tStanza], context *types.Context, errorChannel chan error, ) ( @@ -247,9 +247,8 @@ func (reader *RecordReaderXTAB) getRecordBatch( for _, stanza := range stanzas.Items { if stanza.commentLines.Len() > 0 { - for f := stanza.commentLines.Front(); f != nil; f = f.Next() { - line := f.Value.(string) - recordsAndContexts.PushBack(types.NewOutputString(line+reader.readerOptions.IFS, context)) + for _, commentLine := range stanza.commentLines.Items { + recordsAndContexts.PushBack(types.NewOutputString(commentLine+reader.readerOptions.IFS, context)) } }