x/time/rate: incomplete dependency injection in Limiter #48020
Labels
FeatureRequest
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I wanted to use x/time/rate.Limiter with client-supplied time behavior. I discovered that this is possible with all the FooN methods except WaitN.
What did you expect to see?
I expected a variety of Wait that lets the client supply clock behavior (both the reading of time and waiting for the advance of time).
What did you see instead?
The implementation of WaitN uses the real clock to read
Now()
and create and use a Timer.The text was updated successfully, but these errors were encountered: