Skip to content

Commit 0d0bcab

Browse files
author
Randall C. O'Reilly
committed
wasn't properly skipping doc.go only dirs due to full path
1 parent 41e4280 commit 0d0bcab

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cmd_pkg.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,12 @@ func buildPkgRecurse(odir, path, rootpath string, exmap map[string]struct{}) err
132132
return fmt.Errorf("gopy-gen: go build / load of package failed with path=%q: %v", path, err)
133133
}
134134
gofiles := bpkg.GoFiles
135-
if len(gofiles) == 0 || (len(gofiles) == 1 && gofiles[0] == "doc.go") {
136-
fmt.Printf("\tskipping dir with no go files or only doc.go file: %s -- %s\n", path, gofiles)
135+
onego := ""
136+
if len(gofiles) == 1 {
137+
_, onego = filepath.Split(gofiles[0])
138+
}
139+
if len(gofiles) == 0 || (len(gofiles) == 1 && onego == "doc.go") {
140+
fmt.Printf("\n--- skipping dir with no go files or only doc.go: %s -- %s\n", path, gofiles)
137141
if len(gofiles) == 0 {
138142
// fmt.Printf("otherfiles: %v\nignorefiles: %v\n", bpkg.OtherFiles, bpkg.IgnoredFiles)
139143
if len(bpkg.OtherFiles) > 0 {
@@ -145,6 +149,7 @@ func buildPkgRecurse(odir, path, rootpath string, exmap map[string]struct{}) err
145149
}
146150
}
147151
} else {
152+
// fmt.Printf("gofiles: %s\n", gofiles)
148153
parsePackage(bpkg)
149154
}
150155

0 commit comments

Comments
 (0)