当前位置: 首页>>代码示例>>Golang>>正文


Golang Issue.State方法代码示例

本文整理汇总了Golang中github.com/google/go-github/github.Issue.State方法的典型用法代码示例。如果您正苦于以下问题:Golang Issue.State方法的具体用法?Golang Issue.State怎么用?Golang Issue.State使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/google/go-github/github.Issue的用法示例。


在下文中一共展示了Issue.State方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: bulkEditStart

func bulkEditStart(issues []*github.Issue) (*github.Issue, []byte) {
	common := new(github.Issue)
	for i, issue := range issues {
		if i == 0 {
			common.State = issue.State
			common.Assignee = issue.Assignee
			common.Labels = issue.Labels
			common.Milestone = issue.Milestone
			continue
		}
		if common.State != nil && getString(common.State) != getString(issue.State) {
			common.State = nil
		}
		if common.Assignee != nil && getUserLogin(common.Assignee) != getUserLogin(issue.Assignee) {
			common.Assignee = nil
		}
		if common.Milestone != nil && getMilestoneTitle(common.Milestone) != getMilestoneTitle(issue.Milestone) {
			common.Milestone = nil
		}
		common.Labels = commonLabels(common.Labels, issue.Labels)
	}

	var buf bytes.Buffer
	fmt.Fprintf(&buf, "State: %s\n", getString(common.State))
	fmt.Fprintf(&buf, "Assignee: %s\n", getUserLogin(common.Assignee))
	fmt.Fprintf(&buf, "Labels: %s\n", strings.Join(getLabelNames(common.Labels), " "))
	fmt.Fprintf(&buf, "Milestone: %s\n", getMilestoneTitle(common.Milestone))
	fmt.Fprintf(&buf, "\n<optional comment here>\n")
	fmt.Fprintf(&buf, "%s\n", bulkHeader)
	for _, issue := range issues {
		fmt.Fprintf(&buf, "%d\t%s\n", getInt(issue.Number), getString(issue.Title))
	}

	return common, buf.Bytes()
}
开发者ID:petermattis,项目名称:issue,代码行数:35,代码来源:edit.go

示例2: OpenIssue

// Mark issue as open.
func OpenIssue(repo string, issue *github.Issue) (*github.Issue, error) {
	temp := "open"
	issue.State = &temp
	closedIssue, err := EditIssue(repo, issue)
	return closedIssue, err
}
开发者ID:butlerx,项目名称:AgileGit,代码行数:7,代码来源:gitissue.go


注:本文中的github.com/google/go-github/github.Issue.State方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。