Skip to content

Commit 68321dd

Browse files
committed
Use nil for optional argument to packages.Visit
1 parent d9fe39d commit 68321dd

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

go/extractor/extractor.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ func ExtractWithFlags(buildFlags []string, patterns []string) error {
132132
pkgsNotFound := make([]string, 0, len(pkgs))
133133

134134
// Do a post-order traversal and extract the package scope of each package
135-
packages.Visit(pkgs, func(pkg *packages.Package) bool {
136-
return true
137-
}, func(pkg *packages.Package) {
135+
packages.Visit(pkgs, nil, func(pkg *packages.Package) {
138136
log.Printf("Processing package %s.", pkg.PkgPath)
139137

140138
if _, ok := pkgInfos[pkg.PkgPath]; !ok {
@@ -200,9 +198,7 @@ func ExtractWithFlags(buildFlags []string, patterns []string) error {
200198
noExtractRe := regexp.MustCompile(`.*(^|` + sep + `)(\.\.|vendor)($|` + sep + `).*`)
201199

202200
// extract AST information for all packages
203-
packages.Visit(pkgs, func(pkg *packages.Package) bool {
204-
return true
205-
}, func(pkg *packages.Package) {
201+
packages.Visit(pkgs, nil, func(pkg *packages.Package) {
206202
for root, _ := range wantedRoots {
207203
pkgInfo := pkgInfos[pkg.PkgPath]
208204
relDir, err := filepath.Rel(root, pkgInfo.PkgDir)

0 commit comments

Comments
 (0)