Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tbpg committed Nov 11, 2020
1 parent e392e61 commit 1d397aa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/godocfx/parse.go
Expand Up @@ -453,6 +453,17 @@ func loadPackages(glob, workingDir string) ([]pkgInfo, error) {
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] {
Expand Down

0 comments on commit 1d397aa

Please sign in to comment.