fmt code style (#950)

This commit is contained in:
田欧 2017-06-15 10:14:25 +08:00 committed by Bo-Yi Wu
parent 6dac8c8a48
commit 1a627c2449
2 changed files with 7 additions and 6 deletions

View File

@ -11,7 +11,6 @@ import (
) )
func rateLimit(c *gin.Context) { func rateLimit(c *gin.Context) {
ip := c.ClientIP() ip := c.ClientIP()
value := int(ips.Add(ip, 1)) value := int(ips.Add(ip, 1))
if value%50 == 0 { if value%50 == 0 {

View File

@ -8,11 +8,13 @@ import (
"github.com/manucorporat/stats" "github.com/manucorporat/stats"
) )
var ips = stats.New() var (
var messages = stats.New() ips = stats.New()
var users = stats.New() messages = stats.New()
var mutexStats sync.RWMutex users = stats.New()
var savedStats map[string]uint64 mutexStats sync.RWMutex
savedStats map[string]uint64
)
func statsWorker() { func statsWorker() {
c := time.Tick(1 * time.Second) c := time.Tick(1 * time.Second)