Skip to content

Commit c27ce4a

Browse files
serprexlance6716
andauthored
avoid utils.Now failing sometime around the year 2262 (#994)
* avoid utils.Now failing in sometime around the year 2262 * ignore conversion lint, varies by platform --------- Co-authored-by: lance6716 <[email protected]>
1 parent 8aa9aa6 commit c27ce4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/now_unix.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ func Now() time.Time {
1515
return time.Now()
1616
}
1717

18-
return time.Unix(0, syscall.TimevalToNsec(tv))
18+
//nolint:unconvert
19+
return time.Unix(int64(tv.Sec), int64(tv.Usec)*1000)
1920
}

0 commit comments

Comments
 (0)