Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enumerate ¶ added in v0.25.2
Enumerate takes an iter.Seq and returns an iter.Seq2 where the first value is an int counter.
func Keys ¶ added in v0.25.2
Keys takes an iter.Seq2 and returns an iter.Seq that iterates over the first value in each pair of values.
func MinFunc ¶ added in v0.25.2
MinFunc returns the minimum element in seq, using cmp to compare elements. If seq has no values, the zero value is returned.
func StopIteration ¶
func StopIteration() error
StopIteration returns a sentinel error that indicates stopping the iteration.
This error should not be propagated further, i.e., if a closure returns this error, the loop should break returning nil error. For example:
f := func(i int) error {
if i == 10 {
return iterutil.StopIteration()
}
return nil
}
for i := range slice {
if err := f(i); err != nil {
return iterutil.Map(err)
}
// continue when nil error
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.