本文整理匯總了Golang中github.com/google/go-github/github.CombinedStatus.Statuses方法的典型用法代碼示例。如果您正苦於以下問題:Golang CombinedStatus.Statuses方法的具體用法?Golang CombinedStatus.Statuses怎麽用?Golang CombinedStatus.Statuses使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/google/go-github/github.CombinedStatus
的用法示例。
在下文中一共展示了CombinedStatus.Statuses方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: addStatus
func addStatus(context string, success bool, ciStatus *github.CombinedStatus) {
status := github.RepoStatus{
Context: stringPtr(context),
}
setStatus(&status, success)
ciStatus.Statuses = append(ciStatus.Statuses, status)
}
示例2: fakeRunGithubE2ESuccess
// fakeRunGithubE2ESuccess imitates the github e2e running, but indicates
// success after a short sleep
func fakeRunGithubE2ESuccess(ciStatus *github.CombinedStatus, shouldPass bool) {
ciStatus.State = stringPtr("pending")
for id := range ciStatus.Statuses {
status := &ciStatus.Statuses[id]
if *status.Context == gceE2EContext {
status.State = stringPtr("pending")
break
}
}
// short sleep like the test is running
time.Sleep(500 * time.Millisecond)
ciStatus.State = stringPtr("success")
found := false
for id := range ciStatus.Statuses {
status := &ciStatus.Statuses[id]
if *status.Context == gceE2EContext {
if shouldPass {
status.State = stringPtr("success")
} else {
status.State = stringPtr("failure")
}
found = true
break
}
}
if !found {
e2eStatus := github.RepoStatus{
Context: stringPtr(gceE2EContext),
State: stringPtr("success"),
}
ciStatus.Statuses = append(ciStatus.Statuses, e2eStatus)
}
}
示例3: failGithubStatus
func failGithubStatus(status github.CombinedStatus) github.CombinedStatus {
s := github.RepoStatus{
Context: stringPtr(gceE2EContext),
State: stringPtr("failure"),
}
status.Statuses = append(status.Statuses, s)
return updateStatusState(status)
}
示例4: claStatus
func claStatus(status github.CombinedStatus) github.CombinedStatus {
s := github.RepoStatus{
Context: stringPtr("cla/google"),
State: stringPtr("success"),
}
status.Statuses = append(status.Statuses, s)
return updateStatusState(status)
}