Skip to content

Commit 51ec01e

Browse files
authored
Update README.md
1 parent 9631f86 commit 51ec01e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ func main() {
5454
"server1": "localhost:6379",
5555
},
5656
})
57-
limiter := redis_rate.NewLimiter(ring)
58-
// Optional.
59-
limiter.Fallback = rate.NewLimiter(rate.Every(time.Second), 100)
60-
61-
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
62-
handler(w, req, limiter)
63-
})
64-
65-
http.HandleFunc("/status", func(w http.ResponseWriter, req *http.Request) {
66-
statusHandler(w, req, limiter)
67-
})
68-
69-
http.HandleFunc("/favicon.ico", http.NotFound)
70-
log.Println("listening on localhost:8888...")
71-
log.Println(http.ListenAndServe("localhost:8888", nil))
57+
limiter := redis_rate.NewLimiter(ring)
58+
// Optional.
59+
limiter.Fallback = rate.NewLimiter(rate.Every(time.Second), 100)
60+
61+
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
62+
handler(w, req, limiter)
63+
})
64+
65+
http.HandleFunc("/status", func(w http.ResponseWriter, req *http.Request) {
66+
statusHandler(w, req, limiter)
67+
})
68+
69+
http.HandleFunc("/favicon.ico", http.NotFound)
70+
log.Println("listening on localhost:8888...")
71+
log.Println(http.ListenAndServe("localhost:8888", nil))
7272
}
7373
```

0 commit comments

Comments
 (0)