We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 711ca1c commit f51c127Copy full SHA for f51c127
rate/rate.go
@@ -199,9 +199,10 @@ func (lim *Limiter) Reserve() *Reservation {
199
// The Limiter takes this Reservation into account when allowing future events.
200
// ReserveN returns false if n exceeds the Limiter's burst size.
201
// Usage example:
202
-// r, ok := lim.ReserveN(time.Now(), 1)
203
-// if !ok {
+// r := lim.ReserveN(time.Now(), 1)
+// if !r.OK() {
204
// // Not allowed to act! Did you remember to set lim.burst to be > 0 ?
205
+// return
206
// }
207
// time.Sleep(r.Delay())
208
// Act()
0 commit comments