Next moves the iterator to the next commit and returns a pointer to it. If there are no more commits, it returns io.EOF.
()
| 63 | // Next moves the iterator to the next commit and returns a pointer to it. If |
| 64 | // there are no more commits, it returns io.EOF. |
| 65 | func (iter *parentCommitNodeIter) Next() (CommitNode, error) { |
| 66 | obj, err := iter.node.ParentNode(iter.i) |
| 67 | if err == object.ErrParentNotFound { |
| 68 | return nil, io.EOF |
| 69 | } |
| 70 | if err == nil { |
| 71 | iter.i++ |
| 72 | } |
| 73 | |
| 74 | return obj, err |
| 75 | } |
| 76 | |
| 77 | // ForEach call the cb function for each commit contained on this iter until |
| 78 | // an error appends or the end of the iter is reached. If ErrStop is sent |