Skip to content

Commit

Permalink
fixed lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
iambenkay committed Dec 17, 2020
1 parent e0e9688 commit ef2377c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions middleware/rate_limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type (
}
)

// DefaultRateLimiterConfig defines default values for RateLimiterConfig
var DefaultRateLimiterConfig = RateLimiterConfig{
Skipper: DefaultSkipper,
}
Expand Down Expand Up @@ -63,9 +64,8 @@ func RateLimiterWithConfig(config RateLimiterConfig) echo.MiddlewareFunc {
allowed := config.Store.ShouldAllow(identifier)
if !allowed {
return c.JSON(http.StatusTooManyRequests, nil)
} else {
return next(c)
}
return next(c)
}
}
}
Expand All @@ -78,7 +78,7 @@ type InMemoryStore struct {
burst int
}

// implements TokenStore.ShouldAllow
// ShouldAllow implements TokenStore.ShouldAllow
func (store *InMemoryStore) ShouldAllow(identifier string) bool {
store.mutex.Lock()
defer store.mutex.Unlock()
Expand Down

0 comments on commit ef2377c

Please sign in to comment.