jonboulle / clockwork

a fake clock for golang
Apache License 2.0
625 stars 57 forks source link

Add Expirations() and BlockUntilContext(...) to FakeClock. #69

Closed DPJacques closed 1 month ago

DPJacques commented 11 months ago

We choose to add both functions in the same commit because any change to the interface requires toilsome updates by downstream users who impelement the interface*. Might as well do both functions at once.

"Go interfaces generally belong in the package that consumes values of the interface type, not a package that implements the interface type." - https://google.github.io/styleguide/go/decisions.html#interfaces

For clarification, the above quote doesn't apply to clockwork.Clock because providing that interface is the intent of this package. However, clockwork.FakeClock's status as an interface means we break downstream users every time we update it :(