fix(internal/godocfx): filter out test packages from other modules (#3197)
Test packages don't have module set, so they aren't filtered out in the
existing check. The order of packages isn't defined as far as I can
tell. So, we may not know to skip a package when we first see it.
diff --git a/internal/godocfx/parse.go b/internal/godocfx/parse.go
index b7ba6ea..52a5e8b 100644
--- a/internal/godocfx/parse.go
+++ b/internal/godocfx/parse.go
@@ -453,6 +453,17 @@
result := []pkgInfo{}
for _, pkgPath := range pkgNames {
+ // Check if pkgPath has prefix of skipped module.
+ skip := false
+ for skipModule := range skippedModules {
+ if strings.HasPrefix(pkgPath, skipModule) {
+ skip = true
+ break
+ }
+ }
+ if skip {
+ continue
+ }
parsedFiles := []*ast.File{}
fset := token.NewFileSet()
for _, f := range pkgFiles[pkgPath] {