Skip to content

Commit

Permalink
fix(internal/godocfx): prevent errors for filtered mods (#5485)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbpg committed Feb 9, 2022
1 parent c6158ca commit 6cb9b89
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions internal/godocfx/main.go
Expand Up @@ -148,6 +148,18 @@ func runCmd(dir, name string, args ...string) error {
}

func process(mod indexEntry, workingDir, outDir string, print bool) error {
filter := []string{
"cloud.google.com/go/analytics",
"cloud.google.com/go/area120",
"cloud.google.com/go/gsuiteaddons",

"google.golang.org/appengine/v2/cmd",
}
if hasPrefix(mod.Path, filter) {
log.Printf("%q filtered out, nothing to do: here is the filter: %q", mod.Path, filter)
return nil
}

// Be sure to get the module and run the module loader in the tempDir.
if err := runCmd(workingDir, "go", "mod", "tidy"); err != nil {
return fmt.Errorf("go mod tidy error: %v", err)
Expand All @@ -159,13 +171,6 @@ func process(mod indexEntry, workingDir, outDir string, print bool) error {

log.Println("Starting to parse")
optionalExtraFiles := []string{}
filter := []string{
"cloud.google.com/go/analytics",
"cloud.google.com/go/area120",
"cloud.google.com/go/gsuiteaddons",

"google.golang.org/appengine/v2/cmd",
}
r, err := parse(mod.Path+"/...", workingDir, optionalExtraFiles, filter)
if err != nil {
return fmt.Errorf("parse: %v", err)
Expand Down

0 comments on commit 6cb9b89

Please sign in to comment.