Exemplo n.º 1
0
func (query *Query) Execute() {
	client := client()

	options := github.IssueListByRepoOptions{State: query.State, Labels: query.Labels}
	issues, _, err := client.Issues.ListByRepo(query.Owner, query.Repo, &options)
	if err != nil {
		logger.Error(err.Error())
	} else if len(issues) == 0 {
		logger.Info("no pulls")
	} else {
		var wg sync.WaitGroup
		for _, issue := range issues {
			if issue.PullRequestLinks != nil {
				wg.Add(1)
				go func() {
					defer wg.Done()
					fmt.Printf("%s\n", fetchByIssueNumber(*client, query.Owner, query.Repo, *issue.Number))
				}()
				wg.Wait()
			}
		}
	}
}
Exemplo n.º 2
0
//Execute adds all child commands to the root command sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd
func Execute() {
	if err := RootCmd.Execute(); err != nil {
		logger.Error(err.Error())
		os.Exit(-1)
	}
}