-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
swag init error building doc.go due to missing package in /golang.org/x/tools/go/loader/testdata/badpkgdecl.go #417
Comments
fix via #418 |
@bruceadowns thanks for you report the issue. 👍 |
Problem of repetition: golang version : 1.14 |
I had the same issue, but it was related to a wrong gopath definition at the beginning of my azure pipelines script. |
golang version: go 1.14
oops it was my mistake we should run
|
My go.mod was in the same directory, but the GOPATH was set to a subfolder of the module-path. I changed it to a higher level and it was working afterwards. But this might be a similar issue. GOPATH and module-path variables in azure pipeline scripts are not 100% clear to me ;) Git Change:
I also changed the repo-dir from the golang version: go 1.13 |
my local laptop no such issue, but when I build docker image and met the issue again, even if I used swag 1.6.7 and my go version is 1.13, use go mod, etc. See details of the docker build failure logs: go: creating new go.mod: module fts |
Any update on this issue ? golang version : 1.15.2 $ swag init |
Describe the bug
swag init is failing with latest change related to go modules.
To Reproduce
Steps to reproduce the behavior:
go get github.com/swaggo/swag/cmd/swag
run swag init
swag init -g cmd/cnc.go
2019/06/25 14:48:36 Generate swagger docs....
2019/06/25 14:48:36 Generate general API Info
2019/06/25 14:48:41 ParseFile error:/home/downsb/go/src/golang.org/x/tools/go/loader/testdata/badpkgdecl.go:1:34: expected 'package', found 'EOF'
Expected behavior
swag init generates docs/doc.go
Screenshots
Your swag version
latest
1.5.1
Your go version
go version go1.12.6 darwin/amd64
go version go1.12.4 linux/amd64
The text was updated successfully, but these errors were encountered: