Skip to content

Commit

Permalink
Simplify buildGitHubClientWithToken
Browse files Browse the repository at this point in the history
  • Loading branch information
ordovicia committed Aug 24, 2023
1 parent 520c751 commit 140698b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,10 @@ func buildGitHubClientWithToken(githubURL string, token string) (*github.Client,
tc := oauth2.NewClient(ctx, ts)

if githubURL == "" {
client = github.NewClient(tc)
} else {
client, err = github.NewEnterpriseClient(githubURL, githubURL, tc)
if err != nil {
return nil, err
}
return github.NewClient(tc), nil
}

return client, nil
return github.NewEnterpriseClient(githubURL, githubURL, tc)
}

func templateFromReader(r io.Reader) (*template.Template, error) {
Expand Down

0 comments on commit 140698b

Please sign in to comment.