Skip to content

Commit

Permalink
Expand stdlib packages when queried (#3606)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamyDev authored Jun 27, 2023
1 parent b766077 commit 6bca142
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion go/tools/gopackagesdriver/packageregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,17 @@ func (pr *PackageRegistry) Match(labels []string) ([]string, []*FlatPackage) {
label = fmt.Sprintf("@%s", label)
}

roots[label] = struct{}{}
if label == RulesGoStdlibLabel {
// For stdlib, we need to append all the subpackages as roots
// since RulesGoStdLibLabel doesn't actually show up in the stdlib pkg.json
for _, pkg := range pr.packagesByID {
if pkg.Standard {
roots[pkg.ID] = struct{}{}
}
}
} else {
roots[label] = struct{}{}
}
}

walkedPackages := map[string]*FlatPackage{}
Expand Down

0 comments on commit 6bca142

Please sign in to comment.