Documentation
¶
Overview ¶
Package iterx provides convenience functions for iterators.
Index ¶
- func CSVFile(file string, fn func(*csv.Reader)) iter.Seq2[[]string, error]
- func CSVReader(r io.Reader, fn func(*csv.Reader)) iter.Seq2[[]string, error]
- func ISlice[T any](s []T) iter.Seq2[int, T]
- func Limit[T any](it iter.Seq[T], n int) iter.Seq[T]
- func Limit2[T any, S any](it iter.Seq2[T, S], n int) iter.Seq2[T, S]
- func LinesFile(file string) iter.Seq2[string, error]
- func LinesReader(r io.Reader) iter.Seq2[string, error]
- func Skip[T any](it iter.Seq[T], n int) iter.Seq[T]
- func Skip2[T any, S any](it iter.Seq2[T, S], n int) iter.Seq2[T, S]
- func Slice[T any](s []T) iter.Seq[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSVFile ¶
CSVFile iterates over CSV entries from a file. fn is an optional function for modifying the CSV parser, for example for changing the delimiter.
func CSVReader ¶
CSVReader iterates over CSV entries from a reader. fn is an optional function for modifying the CSV parser, for example for changing the delimiter.
func ISlice ¶
ISlice returns an iterator over the slice values and their indices, like in a range expression.
func Limit ¶
Limit returns an iterator that stops after n elements, if the underlying iterator does not stop before.
func Limit2 ¶
Limit2 returns an iterator that stops after n elements, if the underlying iterator does not stop before.
func LinesReader ¶
LinesReader iterates over text lines from a reader.
Types ¶
This section is empty.