(sec uint64)
| 117 | } |
| 118 | |
| 119 | func secondsToTime(sec uint64) time.Time { |
| 120 | var clamped int64 |
| 121 | if sec > uint64(math.MaxInt64) { |
| 122 | clamped = math.MaxInt64 |
| 123 | } else { |
| 124 | clamped = int64(sec) |
| 125 | } |
| 126 | |
| 127 | return time.Unix(clamped, 0).UTC() |
| 128 | } |
| 129 | |
| 130 | func secondsToDuration(sec uint64) time.Duration { |
| 131 | const maxSeconds = uint64(math.MaxInt64) / uint64(time.Second) |
no outgoing calls