prow/github/fakegithub/fakegithub.go
func (f *FakeClient) AddLabel(owner, repo string, number int, label string) error {
	labelString := fmt.Sprintf("%s/%s#%d:%s", owner, repo, number, label)
	if sets.NewString(f.IssueLabelsAdded...).Has(labelString) {
		return fmt.Errorf("cannot add %v to %s/%s/#%d", label, owner, repo, number)
	}
	if f.RepoLabelsExisting == nil {
		f.IssueLabelsAdded = append(f.IssueLabelsAdded, labelString)
		return nil
	}
	for _, l := range f.RepoLabelsExisting {
		if label == l {
			f.IssueLabelsAdded = append(f.IssueLabelsAdded, labelString)
			return nil
		}
	}
	return fmt.Errorf("cannot add %v to %s/%s/#%d", label, owner, repo, number)
}
func (f *FakeClient) AddLabel(owner, repo string, number int, label string) error {
	labelString := fmt.Sprintf("%s/%s#%d:%s", owner, repo, number, label)
	if sets.NewString(f.IssueLabelsAdded...).Has(labelString) {
		return fmt.Errorf("cannot add %v to %s/%s/#%d", label, owner, repo, number)
	}
	if f.RepoLabelsExisting == nil {
		f.IssueLabelsAdded = append(f.IssueLabelsAdded, labelString)
		return nil
	}
	for _, l := range f.RepoLabelsExisting {
		if label == l {
			f.IssueLabelsAdded = append(f.IssueLabelsAdded, labelString)
			return nil
		}
	}
	return fmt.Errorf("cannot add %v to %s/%s/#%d", label, owner, repo, number)
}
func ( f * FakeClient ) AddLabel ( owner , repo string , number int , label string ) error { labelString := fmt . Sprintf ( " " , owner , repo , number , label ) if sets . NewString ( f . IssueLabelsAdded ... ) . Has ( labelString ) { return fmt . Errorf ( " " , label , owner , repo , number ) } if f . RepoLabelsExisting == nil { f . IssueLabelsAdded = append ( f . IssueLabelsAdded , labelString ) return nil } for _ , l := range f . RepoLabelsExisting { if label == l { f . IssueLabelsAdded = append ( f . IssueLabelsAdded , labelString ) return nil } } return fmt . Errorf ( " " , label , owner , repo , number ) }
// AddLabel adds a label
AddLabel adds a label