This commit is contained in:
Roy Reznik 2025-06-22 12:31:03 +00:00 committed by GitHub
commit e339cf8ea8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -149,7 +149,7 @@ type MainModuleSet struct {
// highest replaced version of each module path; empty string for wildcard-only replacements
highestReplaced map[string]string
indexMu sync.Mutex
indexMu sync.RWMutex
indices map[module.Version]*modFileIndex
}
@ -228,8 +228,8 @@ func (mms *MainModuleSet) GetSingleIndexOrNil() *modFileIndex {
}
func (mms *MainModuleSet) Index(m module.Version) *modFileIndex {
mms.indexMu.Lock()
defer mms.indexMu.Unlock()
mms.indexMu.RLock()
defer mms.indexMu.RUnlock()
return mms.indices[m]
}