Skip to content

Commit ee539cf

Browse files
committed
Remove unnecessary new function
1 parent cbbcacc commit ee539cf

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

modules/util/string.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,3 @@ func SplitTrimSpace(input, sep string) []string {
110110
}
111111
return stringList
112112
}
113-
114-
func StringPointer(s string) *string {
115-
return &s
116-
}

services/migrations/codecommit.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (c *CodeCommitDownloader) SetContext(ctx context.Context) {
9494
// GetRepoInfo returns a repository information
9595
func (c *CodeCommitDownloader) GetRepoInfo() (*base.Repository, error) {
9696
output, err := c.codeCommitClient.GetRepository(c.ctx, &codecommit.GetRepositoryInput{
97-
RepositoryName: util.StringPointer(c.repoName),
97+
RepositoryName: util.ToPointer(c.repoName),
9898
})
9999
if err != nil {
100100
return nil, err
@@ -126,7 +126,7 @@ func (c *CodeCommitDownloader) GetComments(commentable base.Commentable) ([]*bas
126126
for {
127127
resp, err := c.codeCommitClient.GetCommentsForPullRequest(c.ctx, &codecommit.GetCommentsForPullRequestInput{
128128
NextToken: nextToken,
129-
PullRequestId: util.StringPointer(strconv.FormatInt(commentable.GetForeignIndex(), 10)),
129+
PullRequestId: util.ToPointer(strconv.FormatInt(commentable.GetForeignIndex(), 10)),
130130
})
131131
if err != nil {
132132
return nil, false, err
@@ -171,7 +171,7 @@ func (c *CodeCommitDownloader) GetPullRequests(page, perPage int) ([]*base.PullR
171171
prs := make([]*base.PullRequest, 0, len(batch))
172172
for _, id := range batch {
173173
output, err := c.codeCommitClient.GetPullRequest(c.ctx, &codecommit.GetPullRequestInput{
174-
PullRequestId: util.StringPointer(id),
174+
PullRequestId: util.ToPointer(id),
175175
})
176176
if err != nil {
177177
return nil, false, err
@@ -243,7 +243,7 @@ func (c *CodeCommitDownloader) getAllPullRequestIDs() ([]string, error) {
243243

244244
for {
245245
output, err := c.codeCommitClient.ListPullRequests(c.ctx, &codecommit.ListPullRequestsInput{
246-
RepositoryName: util.StringPointer(c.repoName),
246+
RepositoryName: util.ToPointer(c.repoName),
247247
NextToken: nextToken,
248248
})
249249
if err != nil {

0 commit comments

Comments
 (0)