Add == nil to limit's check()

This commit is contained in:
Howl 2016-09-06 19:17:18 +02:00
parent c745947281
commit 6eda6aea87

View File

@ -108,7 +108,7 @@ func (s *RateLimiter) check() {
if s.Map == nil { if s.Map == nil {
s.Map = make(map[string]chan struct{}) s.Map = make(map[string]chan struct{})
} }
if s.Mutex { if s.Mutex == nil {
s.Mutex = new(sync.RWMutex) s.Mutex = new(sync.RWMutex)
} }
} }