File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,9 @@ 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
+ if importedPkg == nil {
247
+ return nil , fmt .Errorf ("package %q possibly creates an import loop" , path )
248
+ }
246
249
247
250
// it's possible to have a call to check in parallel to a call to this
248
251
// if one package in the package graph gets its dependency filtered out,
@@ -255,10 +258,6 @@ func (l *loader) typeCheck(pkg *Package) {
255
258
importedPkg .Lock ()
256
259
defer importedPkg .Unlock ()
257
260
258
- if importedPkg == nil {
259
- return nil , fmt .Errorf ("no package information for %q" , path )
260
- }
261
-
262
261
if importedPkg .Types != nil && importedPkg .Types .Complete () {
263
262
return importedPkg .Types , nil
264
263
}
You can’t perform that action at this time.
0 commit comments