Skip to content

Commit a6a82bb

Browse files
committed
Remove unused function, run 'go fix' again
1 parent 3443ad2 commit a6a82bb

4 files changed

Lines changed: 14 additions & 19 deletions

File tree

bulldozer/evaluate_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,3 @@ func TestShouldUpdatePR(t *testing.T) {
872872
})
873873
}
874874
}
875-
876-
//go:fix inline
877-
func boolVal(b bool) *bool {
878-
return new(b)
879-
}

bulldozer/update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ func UpdatePR(ctx context.Context, pullCtx pull.Context, client *github.Client,
5454

5555
logger.Debug().Msg("Pull request is not up to date, attempting an update")
5656
mergeCommit, _, err := client.Repositories.Merge(ctx, pullCtx.Owner(), pullCtx.Repo(), &github.RepositoryMergeRequest{
57-
Base: github.Ptr(pr.Head.GetRef()),
58-
Head: github.Ptr(baseRef),
57+
Base: new(pr.Head.GetRef()),
58+
Head: new(baseRef),
5959
})
6060
if err != nil {
6161
logger.Error().Err(errors.WithStack(err)).Msg("Update merge failed unexpectedly")

pull/pull_requests_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ func TestGetOpenPullRequestsForSHA(t *testing.T) {
4747
sha := "sha"
4848

4949
pr := &github.PullRequest{
50-
State: github.Ptr("open"),
51-
Head: &github.PullRequestBranch{SHA: github.Ptr(sha)},
50+
State: new("open"),
51+
Head: &github.PullRequestBranch{SHA: new(sha)},
5252
}
5353

5454
mockClient.On("ListPullRequestsWithCommit", ctx, owner, repo, sha, mock.Anything).Return([]*github.PullRequest{pr}, &github.Response{NextPage: 0}, nil)
@@ -69,8 +69,8 @@ func TestListOpenPullRequestsForSHA(t *testing.T) {
6969
sha := "sha"
7070

7171
pr := &github.PullRequest{
72-
State: github.Ptr("open"),
73-
Head: &github.PullRequestBranch{SHA: github.Ptr(sha)},
72+
State: new("open"),
73+
Head: &github.PullRequestBranch{SHA: new(sha)},
7474
}
7575

7676
mockClient.On("List", ctx, owner, repo, mock.Anything).Return([]*github.PullRequest{pr}, &github.Response{NextPage: 0}, nil)
@@ -91,8 +91,8 @@ func TestGetAllPossibleOpenPullRequestsForSHA_FirstMethodReturnsResults(t *testi
9191
sha := "sha"
9292

9393
pr := &github.PullRequest{
94-
State: github.Ptr("open"),
95-
Head: &github.PullRequestBranch{SHA: github.Ptr(sha)},
94+
State: new("open"),
95+
Head: &github.PullRequestBranch{SHA: new(sha)},
9696
}
9797

9898
// Mock the first method to return a valid pull request.
@@ -116,8 +116,8 @@ func TestGetAllPossibleOpenPullRequestsForSHA_SecondMethodReturnsResults(t *test
116116
sha := "sha"
117117

118118
pr := &github.PullRequest{
119-
State: github.Ptr("open"),
120-
Head: &github.PullRequestBranch{SHA: github.Ptr(sha)},
119+
State: new("open"),
120+
Head: &github.PullRequestBranch{SHA: new(sha)},
121121
}
122122

123123
// Mock the first method to return no results.
@@ -178,8 +178,8 @@ func TestListOpenPullRequestsForRef(t *testing.T) {
178178
ref := "refs/heads/main"
179179

180180
pr := &github.PullRequest{
181-
State: github.Ptr("open"),
182-
Base: &github.PullRequestBranch{Ref: github.Ptr("main")},
181+
State: new("open"),
182+
Base: &github.PullRequestBranch{Ref: new("main")},
183183
}
184184

185185
mockClient.On("List", ctx, owner, repo, mock.Anything).Return([]*github.PullRequest{pr}, &github.Response{NextPage: 0}, nil)

server/handler/push.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ func (h *Push) Handle(ctx context.Context, eventType, deliveryID string, payload
4646

4747
// todo: fixup PushEventRepository != Repository
4848
ghRepo := &github.Repository{
49-
Name: github.Ptr(repoName),
49+
Name: new(repoName),
5050
Owner: &github.User{
51-
Login: github.Ptr(owner),
51+
Login: new(owner),
5252
},
5353
}
5454

0 commit comments

Comments
 (0)