Skip to content

Commit f51c127

Browse files
songgaobradfitz
authored andcommitted
rate: change doc for ReserveN to reflect its signature
Change-Id: I97299d5a90b4273f42cb992bcf05b3c4786a2ac7 Reviewed-on: https://go-review.googlesource.com/32239 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 711ca1c commit f51c127

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rate/rate.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,10 @@ func (lim *Limiter) Reserve() *Reservation {
199199
// The Limiter takes this Reservation into account when allowing future events.
200200
// ReserveN returns false if n exceeds the Limiter's burst size.
201201
// Usage example:
202-
// r, ok := lim.ReserveN(time.Now(), 1)
203-
// if !ok {
202+
// r := lim.ReserveN(time.Now(), 1)
203+
// if !r.OK() {
204204
// // Not allowed to act! Did you remember to set lim.burst to be > 0 ?
205+
// return
205206
// }
206207
// time.Sleep(r.Delay())
207208
// Act()

0 commit comments

Comments
 (0)