-
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
panic: runtime error: invalid memory address or nil pointer dereference #567
Comments
Please let me know if you swag was built with |
it is build with |
swag init --parseDependency -g cmd/api/main.go goroutine 1 [running]: build swag from latest source |
@ubogdan do you have any idea for this error? Thank you. |
I am also facing the same issue, is there any progress to this? |
If I leave out |
I changed parser.go:1409 so it won't panic but then I hit #534 |
@kolaente vendor mod is OK. |
@hyacinthus I was able to reproduce this with my OSS-project in a docker container:
(The make command installs swag from vendor in the correct version by running |
@kolaente After |
@hyacinthus Then swag is unable to find some struct from my dependencies, which is different every time I run it. |
After you download all your dep pkg to vendor folder, the swag will find your struct definition from vendor folder. I don't like use vendor mod, so I run swag in a CI job, and only gen the swagger file, then I show it in another swagger UI project. Now swag no longer invaded my code. |
@hyacinthus You mean once I have all my dependencies in When running swag with the |
Try to use |
@hyacinthus When running with |
Hi, |
With 1.6.6 released, it won't panic anymore, but swag is still unable to find dependencies in my |
Closing: fixed. |
I have swagg 1.16, and it generated this problem again, just out of nowhere. Using --parseVendor --parseDependency |
Describe the bug
panic: runtime error: invalid memory address or nil pointer dereference when I use
swag init --parseDependency
To Reproduce
The annotation are as follows
Your swag version
swag version v1.6.3
Your go version
go version go1.12.7 linux/amd64
The text was updated successfully, but these errors were encountered: