func (cfg *Config) checkBadge(b *cbpb.Build) error {
	if cfg.badgeBucket == "" {
		return errors.New("BADGE_BUCKET not set")
	}
	if b.BuildTriggerId == "" {
		return errors.New("build not started by a trigger")
	}
	if _, ok := badgeStatuses[b.Status]; !ok {
		return fmt.Errorf("non-badge status %q", b.Status)
	}
	return nil
}
// checkBadge returns nil if a badge image should be written for b
// per cfg and a descriptive error otherwise.
checkBadge returns nil if a badge image should be written for b
per cfg and a descriptive error otherwise.
// checkBadge returns nil if a badge image should be written for b // per cfg and a descriptive error otherwise .
func (cfg *Config) checkBadge(b *cbpb.Build) error {
	if cfg.badgeBucket == "" {
		return errors.New("BADGE_BUCKET not set")
	}
	if b.BuildTriggerId == "" {
		return errors.New("build not started by a trigger")
	}
	if _, ok := badgeStatuses[b.Status]; !ok {
		return fmt.Errorf("non-badge status %q", b.Status)
	}
	return nil
}
func ( cfg * Config ) checkBadge ( b * cbpb . Build ) error { if cfg . badgeBucket == " " { return errors . New ( " " ) } if b . BuildTriggerId == " " { return errors . New ( " " ) } if _ , ok := badgeStatuses [ b . Status ] ; ! ok { return fmt . Errorf ( " " , b . Status ) } return nil }
checkBadge returns nil if a badge image should be written for b
per cfg and a descriptive error otherwise.
checkBadge returns nil if a badge image should be written for b per cfg and a descriptive error otherwise .