Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

pkger fails if a project contains a .go directory #76

Closed
ghouscht opened this issue Mar 4, 2020 · 0 comments
Closed

pkger fails if a project contains a .go directory #76

ghouscht opened this issue Mar 4, 2020 · 0 comments

Comments

@ghouscht
Copy link
Contributor

ghouscht commented Mar 4, 2020

Hi,
pkger fails if a project contains a folder named .go - I know probably not the best name, better don't ask about the details 😄

2020/03/04 13:57:55 read /work/go/patty/.go: is a directory: ParseDir failed /work/go/patty: /work/go/patty

The call to the go parser (in parser.go#L113) is called without a filter and the docs say:

ParseDir calls ParseFile for all files with names ending in ".go" in the directory specified by path and returns a map of package name -> package AST with all the packages found.

so a directory named .go is included and later passed to ParseFile (parser.go#L65) which returns the error.
Solution is simple though, just call ParseDirwith a filter to exclude directories.

markbates added a commit that referenced this issue Mar 4, 2020
fix pkger error if a project contains a .go directory #76
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants