code: func ForEachIterator(iter bareIterator, cb func(plumbing.EncodedObject) error) error {
  	defer iter.Close()
  	for {
  		obj, err := iter.Next()
  		if err != nil {
  			if err == io.EOF {
  				return nil
  			}
  
  			return err
  		}
  
  		if err := cb(obj); err != nil {
  			if err == ErrStop {
  				return nil
  			}
  
  			return err
  		}
  	}
  }
docs: // ForEachIterator is a helper function to build iterators without need to
  // rewrite the same ForEach function each time.