Skip to content

Commit 4bc8785

Browse files
authored
fix(internal/godocfx): better support for v2 modules (#12797)
Added sorting to package processing so v1 module sort before v2, avoids a panic that was filtering away all results. Also added one more module to skiplist.
1 parent 51583bd commit 4bc8785

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

internal/godocfx/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ func process(mod indexEntry, workingDir, outDir string, namer *friendlyAPINamer,
174174
"cloud.google.com/go/gsuiteaddons",
175175

176176
"google.golang.org/appengine/v2/cmd",
177+
"cloud.google.com/go/spanner/benchmarks",
177178
}
178179
if hasPrefix(mod.Path, filter) {
179180
log.Printf("%q filtered out, nothing to do: here is the filter: %q", mod.Path, filter)

internal/godocfx/pkgload/load.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ func Load(glob, workingDir string, filter []string) ([]Info, error) {
5757
return nil, fmt.Errorf("pattern %q matched 0 packages", glob)
5858
}
5959

60+
// To sort v1 modules before v2+
61+
sort.Slice(allPkgs, func(i, j int) bool {
62+
return allPkgs[i].PkgPath < allPkgs[j].PkgPath
63+
})
6064
module := allPkgs[0].Module
6165
skippedModules := map[string]struct{}{}
6266

0 commit comments

Comments
 (0)