Пример #1
0
func removeComment(gh *octokat.Client, repo octokat.Repo, prNum, commentType string) error {
	// get the comments
	comments, err := gh.Comments(repo, prNum, &octokat.Options{})
	if err != nil {
		return err
	}

	// check if we already made the comment
	for _, c := range comments {
		// if we already made the comment return nil
		if strings.ToLower(c.User.Login) == "gordontheturtle" && strings.Contains(c.Body, commentType) {
			return gh.RemoveComment(repo, c.Id)
		}
	}

	return nil
}