Skip to content

Commit 4b9c92d

Browse files
tdakkotaphilippgille
authored andcommitted
fix gomap datarace: delete is not threadsafe
1 parent d65f8ee commit 4b9c92d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

gomap/gomap.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ func (s Store) Delete(k string) error {
6565
return err
6666
}
6767

68+
s.lock.Lock()
69+
defer s.lock.Unlock()
6870
delete(s.m, k)
6971
return nil
7072
}

0 commit comments

Comments
 (0)