Example #1
0
// Create a label for a repo.
func CreateLabel(repo, labelName string) (github.Label, error) {
	s := strings.Split(repo, "/")
	label := new(github.Label)
	label.Name = &labelName
	temp, _, err := client.Issues.CreateLabel(s[0], s[1], label)
	newLabel := *temp
	return newLabel, err
}
Example #2
0
// Change the name of a label.
func EditLabel(repo, labelName, newName string) (github.Label, error) {
	s := strings.Split(repo, "/")
	label := new(github.Label)
	label.Name = &newName
	temp, _, err := client.Issues.EditLabel(s[0], s[1], labelName, label)
	editedLabel := *temp
	if err == nil {
		_, err = Issues(repo)
	}
	return editedLabel, err
}