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?
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:
Once
package docs
got generated inside 'package main', I moved that package dir to the project root and nextswag fmt
goes without any issue.I wonder if there a predefined way to set a path to the
main
package?