File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,18 @@ func (l *loader) typeCheck(pkg *Package) {
243
243
244
244
// The imports map is keyed by import path.
245
245
importedPkg := pkg .Imports ()[path ]
246
+
247
+ // it's possible to have a call to check in parallel to a call to this
248
+ // if one package in the package graph gets its dependency filtered out,
249
+ // but another doesn't (so one wants a "dummy" package here, and another
250
+ // wants the full check).
251
+ //
252
+ // Thus, we need to lock here (at least for the time being) to avoid
253
+ // races between the above write to `pkg.Types` and this checking of
254
+ // importedPkg.Types.
255
+ importedPkg .Lock ()
256
+ defer importedPkg .Unlock ()
257
+
246
258
if importedPkg == nil {
247
259
return nil , fmt .Errorf ("no package information for %q" , path )
248
260
}
You can’t perform that action at this time.
0 commit comments