diff --git a/gomap/gomap.go b/gomap/gomap.go index 65331d5..1a98323 100644 --- a/gomap/gomap.go +++ b/gomap/gomap.go @@ -65,6 +65,8 @@ func (s Store) Delete(k string) error { return err } + s.lock.Lock() + defer s.lock.Unlock() delete(s.m, k) return nil } diff --git a/test/test.go b/test/test.go index f97b8cb..3d4f03d 100644 --- a/test/test.go +++ b/test/test.go @@ -353,4 +353,14 @@ func InteractWithStore(store gokv.Store, key string, t *testing.T, waitGroup *sy if err != nil { t.Error(err) } + // Delete + err = store.Delete(key) + if err != nil { + t.Error(err) + } + // Read + _, err = store.Get(key, new(Foo)) + if err != nil { + t.Error(err) + } }