We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8552bcf commit 6ad6f6aCopy full SHA for 6ad6f6a
src/cmd/go/internal/modload/init.go
@@ -149,7 +149,7 @@ type MainModuleSet struct {
149
// highest replaced version of each module path; empty string for wildcard-only replacements
150
highestReplaced map[string]string
151
152
- indexMu sync.Mutex
+ indexMu sync.RWMutex
153
indices map[module.Version]*modFileIndex
154
}
155
@@ -228,8 +228,8 @@ func (mms *MainModuleSet) GetSingleIndexOrNil() *modFileIndex {
228
229
230
func (mms *MainModuleSet) Index(m module.Version) *modFileIndex {
231
- mms.indexMu.Lock()
232
- defer mms.indexMu.Unlock()
+ mms.indexMu.RLock()
+ defer mms.indexMu.RUnlock()
233
return mms.indices[m]
234
235
0 commit comments