Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.