Use more idiomatic <int> * <const> for intervals

This commit is contained in:
Mark McGranaghan
2018-02-09 14:14:25 -08:00
parent 1d272218fd
commit 01a5f6de68
15 changed files with 37 additions and 37 deletions

View File

@@ -24,7 +24,7 @@ func main() {
// This `limiter` channel will receive a value
// every 200 milliseconds. This is the regulator in
// our rate limiting scheme.
limiter := time.Tick(time.Millisecond * 200)
limiter := time.Tick(200 * time.Millisecond)
// By blocking on a receive from the `limiter` channel
// before serving each request, we limit ourselves to
@@ -49,7 +49,7 @@ func main() {
// Every 200 milliseconds we'll try to add a new
// value to `burstyLimiter`, up to its limit of 3.
go func() {
for t := range time.Tick(time.Millisecond * 200) {
for t := range time.Tick(200 * time.Millisecond) {
burstyLimiter <- t
}
}()

View File

@@ -1,2 +1,2 @@
b8dbdb8d53386f00ff900fea62db400d962b4834
h9TUTv494TN
edad78bf3b36ddc9bec30b344b8a72be4de90f3b
l4uDE-RCDpa