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() }
()
| 32 | // // continue when nil error |
| 33 | // } |
| 34 | func StopIteration() error { return errStopIteration } |
| 35 | |
| 36 | // Map the nil if it is StopIteration, or keep the error otherwise |
| 37 | func Map(err error) error { |
no outgoing calls
no test coverage detected
searching dependent graphs…