import "k8s.io/kubernetes/pkg/apis/github" issue := &github.Issue{ Labels:[]github.Label{ { Name:"bug", Color:"d73a4a", }, }, } hasBugLabel := mungegithub.HasLabel(issue, "bug")
import "k8s.io/kubernetes/pkg/apis/github" pr := &github.PullRequest{ Labels: []github.Label{ { Name: "priority", Value: "high", }, }, } hasHighPriority := mungegithub.HasLabel(pr, "priority", "high")In this example, we create a pull request object with a "priority" label that has a value of "high". We then use the HasLabel method to check if the pull request has a label with the key "priority" and a value of "high". The result of this check is stored in the hasHighPriority variable. Overall, the HasLabel method is a useful tool for working with labels on GitHub objects in the mungegithub package library.