Skip to content

Commit 1d397aa

Browse files
authored
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.
1 parent e392e61 commit 1d397aa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

internal/godocfx/parse.go

+11
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,17 @@ func loadPackages(glob, workingDir string) ([]pkgInfo, error) {
453453
result := []pkgInfo{}
454454

455455
for _, pkgPath := range pkgNames {
456+
// Check if pkgPath has prefix of skipped module.
457+
skip := false
458+
for skipModule := range skippedModules {
459+
if strings.HasPrefix(pkgPath, skipModule) {
460+
skip = true
461+
break
462+
}
463+
}
464+
if skip {
465+
continue
466+
}
456467
parsedFiles := []*ast.File{}
457468
fset := token.NewFileSet()
458469
for _, f := range pkgFiles[pkgPath] {

0 commit comments

Comments
 (0)