本文整理匯總了Golang中github.com/google/go-github/github.IssueListByRepoOptions.State方法的典型用法代碼示例。如果您正苦於以下問題:Golang IssueListByRepoOptions.State方法的具體用法?Golang IssueListByRepoOptions.State怎麽用?Golang IssueListByRepoOptions.State使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/google/go-github/github.IssueListByRepoOptions
的用法示例。
在下文中一共展示了IssueListByRepoOptions.State方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: IssuesFilter
// Filters issues based on mileston, assignee, creatoror, labels or state.
// Pass empty strings for things that arnt to be filtered.
// Returns array of issues in order asked for.
// TODO(butlerx) filter offline issues if query of repo fails.
func IssuesFilter(repo, state, milestone, assignee, creator, sort, order string, labels []string) ([]github.Issue, error) {
s := strings.Split(repo, "/")
sorting := new(github.IssueListByRepoOptions)
if len(labels) != 0 {
sorting.Labels = labels
}
if state != "" {
sorting.State = state
}
if milestone != "" {
sorting.Milestone = milestone
}
if assignee != "" {
sorting.Assignee = assignee
}
if creator != "" {
sorting.Creator = creator
}
if sort != "" {
sorting.Sort = sort
}
if order != "" {
sorting.Direction = order
}
issues, _, err := client.Issues.ListByRepo(s[0], s[1], sorting)
return issues, err
}