From c3ecb91dbfff3647b5cb224fd9bcc77e8f30e251 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Thu, 14 May 2015 20:50:06 +0200 Subject: [PATCH] Trying fmt --- examples/realtime-advanced/routes.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/realtime-advanced/routes.go b/examples/realtime-advanced/routes.go index a582e4c5..ebb2f008 100644 --- a/examples/realtime-advanced/routes.go +++ b/examples/realtime-advanced/routes.go @@ -1,9 +1,9 @@ package main import ( + "fmt" "html" "io" - "log" "strings" "time" @@ -13,10 +13,10 @@ import ( func rateLimit(c *gin.Context) { ip := c.ClientIP() value := ips.Add(ip, 1) - log.Printf("ip: %s, count: %f\n", ip, value) - if value > 300 { - if int(value)%200 == 0 { - log.Println("ip blocked") + fmt.Printf("ip: %s, count: %f\n", ip, value) + if value >= 300 { + if int(value)%300 == 0 { + fmt.Println("ip blocked") } c.AbortWithStatus(503) }