swaggo / swag

Automatically generate RESTful API documentation with Swagger 2.0 for Go.
MIT License
10.72k stars 1.2k forks source link

ParseFile Error: Expected '(', found '-' #772

Closed JacobAndrewSmith92 closed 4 years ago

JacobAndrewSmith92 commented 4 years ago

Describe the bug I am generating a cookiecutter project in Golang. We have several prompts, one of them being the service name. We are allowing the developer to input values that match this regex r'^[a-z0-9-]*$'. Cookiecutter takes the service name and uses it as a file name. Once the developer goes to generate the project the project fails with this error:

ParseFile error:path/to/file/with-hyphens.go: expected '(', found '-'

I can't find any good information online about this error. Has anyone ran into this issue before? Is this by design?

Expected behavior I should expect that a file name with hyphens would not fail when parsing.

Your swag version 1.6.7

Your go version e.g. 1.14.4

Desktop (please complete the following information):

JacobAndrewSmith92 commented 4 years ago

Non-issue