Part of our code is time sensitive and we need to able to reserve something and then release it in 30-60 seconds etc, which we can just do a time.Sleep(60 * time.Secon
Also if you need to just stub time.Now
you can inject dependency as a function, e.g.
func moonPhase(now func() time.Time) {
if now == nil {
now = time.Now
}
// use now()...
}
// Then dependent code uses just
moonPhase(nil)
// And tests inject own version
stubNow := func() time.Time { return time.Unix(1515151515, 0) }
moonPhase(stubNow)
Granted all that is a bit ugly if you come from dynamic languages background (e.g. Ruby) :(