Use an array
This commit is contained in:
parent
4b03cb112c
commit
15770881bb
5 changed files with 9 additions and 9 deletions
|
|
@ -315,7 +315,7 @@ func prView(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args...)
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -342,7 +342,7 @@ func prClose(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args...)
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -377,7 +377,7 @@ func prReopen(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args...)
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -414,7 +414,7 @@ func prMerge(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args...)
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -657,7 +657,7 @@ func prReady(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args...)
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ func prCheckout(cmd *cobra.Command, args []string) error {
|
|||
}
|
||||
}
|
||||
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, prString)
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, []string{prString})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ func prDiff(cmd *cobra.Command, args []string) error {
|
|||
return fmt.Errorf("could not determine base repo: %w", err)
|
||||
}
|
||||
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args...)
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not find pull request: %w", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import (
|
|||
"github.com/cli/cli/internal/ghrepo"
|
||||
)
|
||||
|
||||
func prFromArgs(ctx context.Context, apiClient *api.Client, repo ghrepo.Interface, args ...string) (*api.PullRequest, error) {
|
||||
func prFromArgs(ctx context.Context, apiClient *api.Client, repo ghrepo.Interface, args []string) (*api.PullRequest, error) {
|
||||
if len(args) == 0 {
|
||||
return prForCurrentBranch(ctx, apiClient, repo)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ func prReview(cmd *cobra.Command, args []string) error {
|
|||
return fmt.Errorf("could not determine base repo: %w", err)
|
||||
}
|
||||
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args...)
|
||||
pr, err := prFromArgs(ctx, apiClient, baseRepo, args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue