本文整理匯總了Golang中github.com/evergreen-ci/evergreen/model.Project.FindProjectTask方法的典型用法代碼示例。如果您正苦於以下問題:Golang Project.FindProjectTask方法的具體用法?Golang Project.FindProjectTask怎麽用?Golang Project.FindProjectTask使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/evergreen-ci/evergreen/model.Project
的用法示例。
在下文中一共展示了Project.FindProjectTask方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: verifyTaskRequirements
// Makes sure that the dependencies for the tasks have the correct fields,
// and that the fields reference valid tasks.
func verifyTaskRequirements(project *model.Project) []ValidationError {
errs := []ValidationError{}
for _, bvt := range project.FindAllBuildVariantTasks() {
for _, r := range bvt.Requires {
if project.FindProjectTask(r.Name) == nil {
if r.Name == model.AllDependencies {
errs = append(errs, ValidationError{Message: fmt.Sprintf(
"task '%v': * is not supported for requirement selectors", bvt.Name)})
} else {
errs = append(errs,
ValidationError{Message: fmt.Sprintf(
"task '%v' requires non-existent task '%v'", bvt.Name, r.Name)})
}
}
if r.Variant != "" && r.Variant != model.AllVariants && project.FindBuildVariant(r.Variant) == nil {
errs = append(errs, ValidationError{Message: fmt.Sprintf(
"task '%v' requires non-existent variant '%v'", bvt.Name, r.Variant)})
}
}
}
return errs
}