Skip to content

Commit 1c39d8a

Browse files
committed
Merge pull request #15 from blu3gui7ar/master
Bug Fix: avoid parsing directories with '.go' extension
2 parents a60c6a1 + b30c9e8 commit 1c39d8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ func init() {
4848
}
4949

5050
func walkDir(names []string, dir string) ([]string, error) {
51-
e := filepath.Walk(dir, func(path string, _ os.FileInfo, err error) error {
51+
e := filepath.Walk(dir, func(path string, finfo os.FileInfo, err error) error {
5252
if err != nil {
5353
return err
5454
}
55-
if strings.HasSuffix(path, ".go") {
55+
if strings.HasSuffix(path, ".go") && !finfo.IsDir() {
5656
names = append(names, path)
5757
}
5858
return nil

0 commit comments

Comments
 (0)