Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for 'main' package outside of project root #268

Open
igorfraa opened this issue May 25, 2023 · 0 comments
Open

support for 'main' package outside of project root #268

igorfraa opened this issue May 25, 2023 · 0 comments

Comments

@igorfraa
Copy link

Hello,

Our go code style guide suggests to have package main main.go not in the project root, namely in './main/' subdir.

When run swagger init from project root, I get the following:

2023/05/25 13:01:15 warning: failed to get package name in dir: ./, error: execute go list command, exit status 1, stdout:, stderr:no Go files in /Users/igorfraa/<...>/go-template/
2023/05/25 13:01:16 cannot parse source files Users/igorfraa/<...>/go-template/main.go: open Users/igorfraa/<...>/go-template/main.go: no such file or directory

Once package docs got generated inside 'package main', I moved that package dir to the project root and next swag fmt goes without any issue.

I wonder if there a predefined way to set a path to the main package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant