Skip to content

Commit 66d953e

Browse files
committed
oops missed one
1 parent b4f3bb3 commit 66d953e

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

go/tools/gopackagesdriver/packageregistry.go

+4-14
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package main
1616

1717
import (
1818
"fmt"
19-
"os"
2019
"strings"
2120

2221
"golang.org/x/tools/go/packages"
@@ -58,13 +57,12 @@ func (pr *PackageRegistry) Add(pkgs ...*FlatPackage) *PackageRegistry {
5857
Imports: imports,
5958
}
6059

61-
pr.packagesByID[pkg.ID] = pkg
62-
63-
// TODO(ellie): wtf why does this fix things
64-
if flatPkg.IsStdlib() {
60+
if len(pkg.CompiledGoFiles) <= 0 {
6561
pkg.CompiledGoFiles = pkg.GoFiles
6662
}
6763

64+
pr.packagesByID[pkg.ID] = pkg
65+
6866
if flatPkg.IsStdlib() {
6967
pr.stdlib[pkg.PkgPath] = pkg
7068
}
@@ -110,19 +108,11 @@ func (pr *PackageRegistry) walk(acc map[string]*packages.Package, root string) {
110108
pkg := pr.packagesByID[root]
111109

112110
if pkg == nil {
113-
fmt.Fprintf(os.Stderr, "Error: package ID not found %v\n", root)
114111
return
115112
}
116113

117114
acc[pkg.ID] = pkg
118-
for imp, pkgI := range pkg.Imports {
119-
if pkgI == nil {
120-
fmt.Fprintf(os.Stderr, "Error: import %s for package %v not resolved\n", imp, root)
121-
if _, ok := pr.stdlib[imp]; ok {
122-
fmt.Fprintf(os.Stderr, "import was stdlib\n")
123-
}
124-
continue
125-
}
115+
for _, pkgI := range pkg.Imports {
126116
if _, ok := acc[pkgI.ID]; !ok {
127117
pr.walk(acc, pkgI.ID)
128118
}

0 commit comments

Comments
 (0)