Describe the bug
When using this with go modules:
If the module only has sub packages and no package itself
$ tree
.
โโโ a
โ โโโ a.go
โโโ b
โ โโโ b.go
โโโ go.mod
then swag init will fail.
The error message is:
2019/07/02 16:36:50 execute go list command, exit status 1, stdout:, stderr:can't load package: package gitlab.com/fino/uba: unknown import path "path/to/module": cannot find module providing package path/to/module
Creating a random go file that contains the package
I think you are using go list on the ./ directory, which causes this
Expected behavior
It should work without a redundant "root" package in the module
Screenshots
If applicable, add screenshots to help explain your problem.

Your swag version
e.g. 1.6.0
Your go version
e.g. 1.12.6
Desktop (please complete the following information):
Thanks for report it, I will fix tmr.
I am running into this with the a module that exists outside of the GOPATH. I notice the command used is just go list -f={{.ImportPath}} but locally that command does not work, the command that does is go list -f={{.ImportPath}} ./...
I believe the change needs to be made in parser.go on line 111 to:
cmd := exec.Command("go", "list", "-f={{.ImportPath}}", "./...")
but I have not dived any deeper for my case.
@LennyPenny Please try again using the latest version.
yup it works now, thanks a lot!
Most helpful comment
Thanks for report it, I will fix tmr.