fix(gotool_extractor): mark dep as missing if it cannot be built
@@ -514,7 +514,10 @@ func (p *Package) addDeps(cu *apb.CompilationUnit, importPaths []string, localPa
for _, ip := range importPaths {
if ip == "unsafe" {
// package unsafe is intrinsic; nothing to do
- } else if dep, err := p.ext.addPackage(ip, localPath); err != nil {
+ } else if dep, err := p.ext.addPackage(ip, localPath); err != nil || dep.PkgObj == "" {
+ // Package was either literally missing or could not be built properly.
+ // Note: Locate could have added a dependency package that could not be
+ // built as part of its earlier analysis.
missing = append(missing, ip)
} else {
p.addInput(cu, dep)
