Closed
Description
I'd like to propose that a time.Until(t time.Time) time.Duration
function be added to the time package to compliment the existing Since()
shortcut. This would make writing expressions with an expiration time a bit more readable:
<-After(time.Until(expirationTime))
vs.
<-After(expirationTime.Sub(time.Now()))
While it's still fairly obvious what the second one does, it takes a little longer to recognize "sub" as subtraction than just seeing the symbol. Also keeping time expressions more or less readable as english is a nice benefit of having the until shortcut (as you can do with the existing since function).
If this accepted, I've got a CL here for review.