예제 #1
0
func (s *FakeBundleCollection) checkBundle(bundle bc.Bundle) error {
	if len(bundle.BundleName()) == 0 {
		return errors.New("missing bundle name")
	}
	if len(bundle.BundleVersion()) == 0 {
		return errors.New("missing bundle version")
	}
	return nil
}
예제 #2
0
func (s *FakeBundleCollection) checkExists(collection []bc.Bundle, bundle bc.Bundle) bool {
	for _, b := range collection {
		if b.BundleName() == bundle.BundleName() {
			if b.BundleVersion() == bundle.BundleVersion() {
				return true
			}
		}
	}
	return false
}