You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great package, but I'm confused by the presence of a top level set of functions, e.g. clock.Now().
This makes it easier to do silly bugs like:
typesomeStruct {
clock clock.Clock
}
func (ssomeStruct) someTimeCriticalFunc() {
currentTime:=clock.Now() // should be s.clock.Now()
}
Ignoring backwards compatibility for a second, what is the benefit of having the clock.Now() function? Anyone who specifically wants the real time can just call clock.New().Now(). Or even just call time.Now(), since they obviously know they need the correct time at that point in their code.
I thought the whole point of this library would be to force users to access all time information through an interface.
The text was updated successfully, but these errors were encountered:
Great package, but I'm confused by the presence of a top level set of functions, e.g.
clock.Now()
.This makes it easier to do silly bugs like:
Ignoring backwards compatibility for a second, what is the benefit of having the
clock.Now()
function? Anyone who specifically wants the real time can just callclock.New().Now()
. Or even just calltime.Now()
, since they obviously know they need the correct time at that point in their code.I thought the whole point of this library would be to force users to access all time information through an interface.
The text was updated successfully, but these errors were encountered: