diff --git a/main.go b/main.go index b2211eb..b7a13f2 100644 --- a/main.go +++ b/main.go @@ -37,7 +37,6 @@ func main() { repo := gitRoot() pkgSeen := make(map[string]bool) - var modifiedPackages []*build.Package buildContext := build.Default for _, f := range files { if isIgnored(f) { @@ -59,7 +58,6 @@ func main() { } pkgSeen[pkg.ImportPath] = true - modifiedPackages = append(modifiedPackages, pkg) } // TODO: list all packages in the repo, determine dependency tree and filter package list to those that transitively import affected packages @@ -75,6 +73,10 @@ func main() { return } + if isIgnored(importPath) { + return + } + pkg, err := buildContext.Import(importPath, repo, build.AllowBinary) if err, ok := err.(*build.NoGoError); err != nil && ok { return @@ -96,8 +98,8 @@ func main() { // filter the package list to those affected var affectedPackages []string - for _, p := range modifiedPackages { - affectedPackages = append(affectedPackages, p.ImportPath) + for path := range pkgSeen { + affectedPackages = append(affectedPackages, path) } addedMore := true for addedMore {