Comment by tux3

1 day ago

I thankfully found out when writing unit tests instead of in production. In Go time.Time has a much higher range than time.Duration, so it's very easy to have an overflow when you take a time difference. But there's also no error returned in general when manipulating time.Duration, you have to remember to check carefully around each operation to know if it risks going out of range.

Internally time.Duration is a single 64bit count, while time.Time is two more complicated 64bit fields plus a location