Skip to content

Commit

Permalink
oops missed one
Browse files Browse the repository at this point in the history
  • Loading branch information
ellie-idb committed Jan 20, 2025
1 parent 4bd55a0 commit 233b76b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions go/tools/gopackagesdriver/packageregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ func (pr *PackageRegistry) Add(pkgs ...*FlatPackage) *PackageRegistry {
Imports: imports,
}

pr.packagesByID[pkg.ID] = pkg

// TODO(ellie): wtf why does this fix things
if flatPkg.IsStdlib() {
if len(pkg.CompiledGoFiles) <= 0 {
pkg.CompiledGoFiles = pkg.GoFiles
}

pr.packagesByID[pkg.ID] = pkg

if flatPkg.IsStdlib() {
pr.stdlib[pkg.PkgPath] = pkg
}
Expand Down Expand Up @@ -116,13 +115,6 @@ func (pr *PackageRegistry) walk(acc map[string]*packages.Package, root string) {

acc[pkg.ID] = pkg
for imp, pkgI := range pkg.Imports {
if pkgI == nil {
fmt.Fprintf(os.Stderr, "Error: import %s for package %v not resolved\n", imp, root)
if _, ok := pr.stdlib[imp]; ok {
fmt.Fprintf(os.Stderr, "import was stdlib\n")
}
continue
}
if _, ok := acc[pkgI.ID]; !ok {
pr.walk(acc, pkgI.ID)
}
Expand Down

0 comments on commit 233b76b

Please sign in to comment.