diff --git a/index/index.go b/index/index.go index 7104c30f..bd6d628e 100644 --- a/index/index.go +++ b/index/index.go @@ -164,9 +164,8 @@ func (index *Index) Get(key string) ([]byte, error) { fileId, offset := deserializeIndexEntry(b) f := index.files[fileId] - readLock := index.readLocks[fileId] - readLock.Lock() - defer readLock.Unlock() + index.readLocks[fileId].Lock() + defer index.readLocks[fileId].Unlock() _, err = f.file.Seek(offset, os.SEEK_SET) if err != nil {