Skip to content

Commit b418765

Browse files
6543sonjek
authored andcommitted
use GetTime() upstreamed helper
google/go-github#2743
1 parent e64c2fa commit b418765

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

services/migrations/github.go

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ func (g *GithubDownloaderV3) GetMilestones() ([]*base.Milestone, error) {
256256
milestones = append(milestones, &base.Milestone{
257257
Title: m.GetTitle(),
258258
Description: m.GetDescription(),
259-
Deadline: convertGithubTimestampToTime(m.DueOn),
259+
Deadline: m.DueOn.GetTime(),
260260
State: state,
261261
Created: m.GetCreatedAt().Time,
262-
Updated: convertGithubTimestampToTime(m.UpdatedAt),
263-
Closed: convertGithubTimestampToTime(m.ClosedAt),
262+
Updated: m.UpdatedAt.GetTime(),
263+
Closed: m.ClosedAt.GetTime(),
264264
})
265265
}
266266
if len(ms) < perPage {
@@ -715,11 +715,11 @@ func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullReq
715715
State: pr.GetState(),
716716
Created: pr.GetCreatedAt().Time,
717717
Updated: pr.GetUpdatedAt().Time,
718-
Closed: convertGithubTimestampToTime(pr.ClosedAt),
718+
Closed: pr.ClosedAt.GetTime(),
719719
Labels: labels,
720720
Merged: pr.MergedAt != nil,
721721
MergeCommitSHA: pr.GetMergeCommitSHA(),
722-
MergedTime: convertGithubTimestampToTime(pr.MergedAt),
722+
MergedTime: pr.MergedAt.GetTime(),
723723
IsLocked: pr.ActiveLockReason != nil,
724724
Head: base.PullRequestBranch{
725725
Ref: pr.GetHead().GetRef(),
@@ -878,10 +878,3 @@ func (g *GithubDownloaderV3) GetReviews(reviewable base.Reviewable) ([]*base.Rev
878878
}
879879
return allReviews, nil
880880
}
881-
882-
func convertGithubTimestampToTime(t *github.Timestamp) *time.Time {
883-
if t == nil {
884-
return nil
885-
}
886-
return &t.Time
887-
}

0 commit comments

Comments
 (0)