import "k8s.io/contrib/mungegithub/github" func main() { prNumber := 123 comments, err := github.MungeObject.ListComments(prNumber) if err != nil { log.Fatalf("Error retrieving comments: %v", err) } for _, comment := range comments { fmt.Printf("%s said: %s\n", comment.User.Login, comment.Body) } }
import "k8s.io/contrib/mungegithub/github" func main() { issueNumber := 456 comments, err := github.MungeObject.ListComments(issueNumber) if err != nil { log.Fatalf("Error retrieving comments: %v", err) } for _, comment := range comments { fmt.Printf("%s said: %s\n", comment.User.Login, comment.Body) } }This code is similar to the previous example, but retrieves the comments on a specific issue (#456) instead of a pull request. It then loops through each comment and prints out the username and comment content. Overall, the MungeObject ListComments function is a useful tool for retrieving comments on GitHub issues and pull requests through the Kubernetes Mungebot.