MCPcopy Index your code
hub / github.com/go-git/go-git / Next

Method Next

plumbing/object/object.go:184–202  ·  view source on GitHub ↗

Next moves the iterator to the next object and returns a pointer to it. If there are no more objects, it returns io.EOF.

()

Source from the content-addressed store, hash-verified

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.
184func (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

Callers 1

TestObjectIterMethod · 0.95

Calls 2

toObjectMethod · 0.95
NextMethod · 0.65

Tested by 1

TestObjectIterMethod · 0.76