Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ianling committed Feb 3, 2022
1 parent 86c6409 commit bf68769
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions client/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (c *Client) GetRepos(ctx context.Context, name string) ([]*github.Repositor
count := 0
orgFound := true

c.rate.Wait(ctx) //nolint: errcheck
c.rate.Wait(ctx) // nolint: errcheck
org, resp, err := c.ghClient.Organizations.Get(ctx, name)
if resp == nil && err != nil {

Expand All @@ -29,7 +29,7 @@ func (c *Client) GetRepos(ctx context.Context, name string) ([]*github.Repositor
if resp.StatusCode == http.StatusNotFound {
orgFound = false

c.rate.Wait(ctx) //nolint: errcheck
c.rate.Wait(ctx) // nolint: errcheck
user, _, err := c.ghClient.Users.Get(ctx, name)
if err != nil {
if _, ok := err.(*github.RateLimitError); ok {
Expand Down Expand Up @@ -74,7 +74,7 @@ func (c *Client) GetRepos(ctx context.Context, name string) ([]*github.Repositor
var repos []*github.Repository
for {
var rs []*github.Repository
c.rate.Wait(ctx) //nolint: errcheck
c.rate.Wait(ctx) // nolint: errcheck
if orgFound {
rs, resp, err = c.ghClient.Repositories.ListByOrg(ctx, name, orgOpts)
} else {
Expand Down Expand Up @@ -185,7 +185,7 @@ func (c *Client) processRepo(ctx context.Context, repo *github.Repository, dryRu
owner := repo.GetOwner().GetLogin()
head := repo.GetDefaultBranch()

c.rate.Wait(ctx) //nolint: errcheck
c.rate.Wait(ctx) // nolint: errcheck
_, _, err := c.ghClient.Repositories.GetBranch(ctx, owner, name, c.cfg.ReleaseBranch)
if err != nil {
return "", fmt.Errorf("get branch: %v", err.Error())
Expand All @@ -196,7 +196,7 @@ func (c *Client) processRepo(ctx context.Context, repo *github.Repository, dryRu
Base: c.cfg.ReleaseBranch,
}

c.rate.Wait(ctx) //nolint: errcheck
c.rate.Wait(ctx) // nolint: errcheck
prs, _, err := c.ghClient.PullRequests.List(ctx, owner, name, opts)
if err != nil {
return "", fmt.Errorf("list prs: %v", err.Error())
Expand All @@ -213,7 +213,7 @@ func (c *Client) processRepo(ctx context.Context, repo *github.Repository, dryRu
pr.Body = github.String(body)

if !dryRun {
c.rate.Wait(ctx) //nolint: errcheck
c.rate.Wait(ctx) // nolint: errcheck
pr, _, _ = c.ghClient.PullRequests.Edit(ctx, owner, name, pr.GetNumber(), pr)
}

Expand All @@ -236,7 +236,7 @@ func (c *Client) processRepo(ctx context.Context, repo *github.Repository, dryRu
}

if !dryRun {
c.rate.Wait(ctx) //nolint: errcheck
c.rate.Wait(ctx) // nolint: errcheck
pr, _, err := c.ghClient.PullRequests.Create(ctx, owner, name, newPR)
if err != nil {
return "", fmt.Errorf("create pr: %v", err.Error())
Expand Down Expand Up @@ -282,7 +282,7 @@ func (c *Client) ReleaseRepos(ctx context.Context, repos []*github.Repository, d
appendStr = fmt.Sprintf("\nCurrent Repo: %v/%v", owner, name)

var err error
c.rate.Wait(ctx) //nolint: errcheck
c.rate.Wait(ctx) // nolint: errcheck
release, _, err = c.ghClient.PullRequests.Get(ctx, owner, name, release.GetNumber())
if err != nil {
return nil, fmt.Errorf("check mergeable: %v", err.Error())
Expand All @@ -294,7 +294,7 @@ func (c *Client) ReleaseRepos(ctx context.Context, repos []*github.Repository, d
}

if !dryRun {
c.rate.Wait(ctx) //nolint: errcheck
c.rate.Wait(ctx) // nolint: errcheck
res, _, err := c.ghClient.PullRequests.Merge(ctx, owner, name, release.GetNumber(), "release automerged by train", nil)
if err != nil {
return nil, fmt.Errorf("merge: %v", err.Error())
Expand Down Expand Up @@ -344,7 +344,7 @@ func (c *Client) getReleases(ctx context.Context, repos []*github.Repository) ([
Base: c.cfg.ReleaseBranch,
}

c.rate.Wait(ctx) //nolint: errcheck
c.rate.Wait(ctx) // nolint: errcheck
rs, _, err := c.ghClient.PullRequests.List(ctx, owner, name, opts)
if err != nil {
return nil, fmt.Errorf("pull requests: %v", err.Error())
Expand Down

0 comments on commit bf68769

Please sign in to comment.