Next moves the iterator to the next object and returns a pointer to it. If there are no more objects, it returns io.EOF.
()
| 182 | // Next moves the iterator to the next object and returns a pointer to it. If |
| 183 | // there are no more objects, it returns io.EOF. |
| 184 | func (iter *ObjectIter) Next() (Object, error) { |
| 185 | for { |
| 186 | obj, err := iter.EncodedObjectIter.Next() |
| 187 | if err != nil { |
| 188 | return nil, err |
| 189 | } |
| 190 | |
| 191 | o, err := iter.toObject(obj) |
| 192 | if err == plumbing.ErrInvalidType { |
| 193 | continue |
| 194 | } |
| 195 | |
| 196 | if err != nil { |
| 197 | return nil, err |
| 198 | } |
| 199 | |
| 200 | return o, nil |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | // ForEach call the cb function for each object contained on this iter until |
| 205 | // an error happens or the end of the iter is reached. If ErrStop is sent |