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

Method ForEach

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

Source from the content-addressed store, hash-verified

787}
788
789func (iter *packfileIter) ForEach(cb func(plumbing.EncodedObject) error) error {
790 for {
791 o, err := iter.Next()
792 if err != nil {
793 if err == io.EOF {
794 iter.Close()
795 return nil
796 }
797 return err
798 }
799
800 if err := cb(o); err != nil {
801 return err
802 }
803 }
804}
805
806func (iter *packfileIter) Close() {
807 iter.iter.Close()

Callers

nothing calls this directly

Calls 2

NextMethod · 0.95
CloseMethod · 0.95

Tested by

no test coverage detected