prow/config/tide.go
func (cp *TideContextPolicy) Validate() error {
	if inter := sets.NewString(cp.RequiredContexts...).Intersection(sets.NewString(cp.OptionalContexts...)); inter.Len() > 0 {
		return fmt.Errorf("contexts %s are defined as required and optional", strings.Join(inter.List(), ", "))
	}
	if inter := sets.NewString(cp.RequiredContexts...).Intersection(sets.NewString(cp.RequiredIfPresentContexts...)); inter.Len() > 0 {
		return fmt.Errorf("contexts %s are defined as required and required if present", strings.Join(inter.List(), ", "))
	}
	if inter := sets.NewString(cp.OptionalContexts...).Intersection(sets.NewString(cp.RequiredIfPresentContexts...)); inter.Len() > 0 {
		return fmt.Errorf("contexts %s are defined as optional and required if present", strings.Join(inter.List(), ", "))
	}
	return nil
}
func (cp *TideContextPolicy) Validate() error {
	if inter := sets.NewString(cp.RequiredContexts...).Intersection(sets.NewString(cp.OptionalContexts...)); inter.Len() > 0 {
		return fmt.Errorf("contexts %s are defined as required and optional", strings.Join(inter.List(), ", "))
	}
	if inter := sets.NewString(cp.RequiredContexts...).Intersection(sets.NewString(cp.RequiredIfPresentContexts...)); inter.Len() > 0 {
		return fmt.Errorf("contexts %s are defined as required and required if present", strings.Join(inter.List(), ", "))
	}
	if inter := sets.NewString(cp.OptionalContexts...).Intersection(sets.NewString(cp.RequiredIfPresentContexts...)); inter.Len() > 0 {
		return fmt.Errorf("contexts %s are defined as optional and required if present", strings.Join(inter.List(), ", "))
	}
	return nil
}
func ( cp * TideContextPolicy ) Validate ( ) error { if inter := sets . NewString ( cp . RequiredContexts ... ) . Intersection ( sets . NewString ( cp . OptionalContexts ... ) ) ; inter . Len ( ) > 0 { return fmt . Errorf ( " " , strings . Join ( inter . List ( ) , " " ) ) } if inter := sets . NewString ( cp . RequiredContexts ... ) . Intersection ( sets . NewString ( cp . RequiredIfPresentContexts ... ) ) ; inter . Len ( ) > 0 { return fmt . Errorf ( " " , strings . Join ( inter . List ( ) , " " ) ) } if inter := sets . NewString ( cp . OptionalContexts ... ) . Intersection ( sets . NewString ( cp . RequiredIfPresentContexts ... ) ) ; inter . Len ( ) > 0 { return fmt . Errorf ( " " , strings . Join ( inter . List ( ) , " " ) ) } return nil }
// Validate returns an error if any contexts are listed more than once in the config.
Validate returns an error if any contexts are listed more than once in the config .