MCPcopy Create free account
hub / github.com/go-git/go-git / ForEach

Method ForEach

storage/filesystem/object.go:838–852  ·  view source on GitHub ↗
(cb func(plumbing.EncodedObject) error)

Source from the content-addressed store, hash-verified

836}
837
838func (iter *objectsIter) ForEach(cb func(plumbing.EncodedObject) error) error {
839 for {
840 o, err := iter.Next()
841 if err != nil {
842 if err == io.EOF {
843 return nil
844 }
845 return err
846 }
847
848 if err := cb(o); err != nil {
849 return err
850 }
851 }
852}
853
854func (iter *objectsIter) Close() {
855 iter.h = []plumbing.Hash{}

Callers

nothing calls this directly

Calls 1

NextMethod · 0.95

Tested by

no test coverage detected