From 8e361f31561d826195509d056d9177f97d852e59 Mon Sep 17 00:00:00 2001 From: ston1th Date: Wed, 17 Jan 2018 22:42:11 +0100 Subject: [PATCH] small bug fix --- blacklist.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blacklist.go b/blacklist.go index 1cb43f7..024796d 100644 --- a/blacklist.go +++ b/blacklist.go @@ -28,21 +28,21 @@ func NewMemBlacklist() *MemBlacklist { } // Add adds a new token signature with expiration time to the blacklist -func (mb MemBlacklist) Add(sig string, exp int64) { +func (mb *MemBlacklist) Add(sig string, exp int64) { mb.Lock() mb.list[sig] = exp mb.Unlock() } // Remove deletes a token signature from the blacklist -func (mb MemBlacklist) Remove(sig string) { +func (mb *MemBlacklist) Remove(sig string) { mb.Lock() delete(mb.list, sig) mb.Unlock() } // Check returns true if a token signature is blacklisted and false otherwise -func (mb MemBlacklist) Check(sig string) (ok bool) { +func (mb *MemBlacklist) Check(sig string) (ok bool) { mb.RLock() _, ok = mb.list[sig] mb.RUnlock() @@ -50,7 +50,7 @@ func (mb MemBlacklist) Check(sig string) (ok bool) { } // Map returns the blacklist in the form of a iterable map structure for cleanup -func (mb MemBlacklist) Map() (list BlacklistMap) { +func (mb *MemBlacklist) Map() (list BlacklistMap) { list = make(BlacklistMap) mb.RLock() for k, v := range mb.list {