use Lock instead of RLock since delete() is a writing operation.

pull/130/head
Tufan Baris Yildirim 2019-01-29 10:49:50 +03:00
parent 3db4f1b373
commit d95abf0728
1 changed files with 2 additions and 2 deletions

View File

@ -58,8 +58,8 @@ func (s Storage) Get(key string) []byte {
}
func (s Storage) Delete(key string) {
s.mu.RLock()
defer s.mu.RUnlock()
s.mu.Lock()
defer s.mu.Unlock()
delete(s.items, key)
}