Skip to content

Commit 4f9ede1

Browse files
committed
use GetTime() upstreamed helper
google/go-github#2743
1 parent 94fde46 commit 4f9ede1

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
@@ -259,11 +259,11 @@ func (g *GithubDownloaderV3) GetMilestones() ([]*base.Milestone, error) {
259259
milestones = append(milestones, &base.Milestone{
260260
Title: m.GetTitle(),
261261
Description: m.GetDescription(),
262-
Deadline: convertGithubTimestampToTime(m.DueOn),
262+
Deadline: m.DueOn.GetTime(),
263263
State: state,
264264
Created: m.GetCreatedAt().Time,
265-
Updated: convertGithubTimestampToTime(m.UpdatedAt),
266-
Closed: convertGithubTimestampToTime(m.ClosedAt),
265+
Updated: m.UpdatedAt.GetTime(),
266+
Closed: m.ClosedAt.GetTime(),
267267
})
268268
}
269269
if len(ms) < perPage {
@@ -718,11 +718,11 @@ func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullReq
718718
State: pr.GetState(),
719719
Created: pr.GetCreatedAt().Time,
720720
Updated: pr.GetUpdatedAt().Time,
721-
Closed: convertGithubTimestampToTime(pr.ClosedAt),
721+
Closed: pr.ClosedAt.GetTime(),
722722
Labels: labels,
723723
Merged: pr.MergedAt != nil,
724724
MergeCommitSHA: pr.GetMergeCommitSHA(),
725-
MergedTime: convertGithubTimestampToTime(pr.MergedAt),
725+
MergedTime: pr.MergedAt.GetTime(),
726726
IsLocked: pr.ActiveLockReason != nil,
727727
Head: base.PullRequestBranch{
728728
Ref: pr.GetHead().GetRef(),
@@ -881,10 +881,3 @@ func (g *GithubDownloaderV3) GetReviews(reviewable base.Reviewable) ([]*base.Rev
881881
}
882882
return allReviews, nil
883883
}
884-
885-
func convertGithubTimestampToTime(t *github.Timestamp) *time.Time {
886-
if t == nil {
887-
return nil
888-
}
889-
return &t.Time
890-
}

0 commit comments

Comments
 (0)