From 0d0bcab6b14468711681540a87a423f4f0878b7d Mon Sep 17 00:00:00 2001 From: "Randall C. O'Reilly" Date: Mon, 23 Nov 2020 18:36:10 -0800 Subject: [PATCH] wasn't properly skipping doc.go only dirs due to full path --- cmd_pkg.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd_pkg.go b/cmd_pkg.go index 5e6c616..9cc1ccd 100644 --- a/cmd_pkg.go +++ b/cmd_pkg.go @@ -132,8 +132,12 @@ func buildPkgRecurse(odir, path, rootpath string, exmap map[string]struct{}) err return fmt.Errorf("gopy-gen: go build / load of package failed with path=%q: %v", path, err) } gofiles := bpkg.GoFiles - if len(gofiles) == 0 || (len(gofiles) == 1 && gofiles[0] == "doc.go") { - fmt.Printf("\tskipping dir with no go files or only doc.go file: %s -- %s\n", path, gofiles) + onego := "" + if len(gofiles) == 1 { + _, onego = filepath.Split(gofiles[0]) + } + if len(gofiles) == 0 || (len(gofiles) == 1 && onego == "doc.go") { + fmt.Printf("\n--- skipping dir with no go files or only doc.go: %s -- %s\n", path, gofiles) if len(gofiles) == 0 { // fmt.Printf("otherfiles: %v\nignorefiles: %v\n", bpkg.OtherFiles, bpkg.IgnoredFiles) if len(bpkg.OtherFiles) > 0 { @@ -145,6 +149,7 @@ func buildPkgRecurse(odir, path, rootpath string, exmap map[string]struct{}) err } } } else { + // fmt.Printf("gofiles: %s\n", gofiles) parsePackage(bpkg) }