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

swag.(*PackagesDefinitions).ParseTypes panic #1303

Closed
jixiuf opened this issue Aug 23, 2022 · 1 comment
Closed

swag.(*PackagesDefinitions).ParseTypes panic #1303

jixiuf opened this issue Aug 23, 2022 · 1 comment

Comments

@jixiuf
Copy link
Contributor

jixiuf commented Aug 23, 2022

Describe the bug

goroutine 1 [running]:
panic({0x1fc9420, 0x2d6e470})
        /usr/local/opt/go@1.18/libexec/src/runtime/panic.go:941 +0x397 fp=0xc009b3f370 sp=0xc009b3f2b0 pc=0x1038ed7
runtime.panicmem(...)
        /usr/local/opt/go@1.18/libexec/src/runtime/panic.go:220
runtime.sigpanic()
        /usr/local/opt/go@1.18/libexec/src/runtime/signal_unix.go:818 +0x327 fp=0xc009b3f3c0 sp=0xc009b3f370 pc=0x104f427
github.com/swaggo/swag.(*PackagesDefinitions).parseFunctionScopedTypesFromFile(0xc000a12048, 0xc002a7b100, {0xc000d8f0b4, 0x2}, 0xc012fdd6e0)
        /Users/jixiuf/go/pkg/mod/github.com/swaggo/swag@v1.8.5-0.20220819205010-732c0879d89d/packages.go:168 +0xa8 fp=0xc009b3f4b8 sp=0xc009b3f3c0 pc=0x1e852e8
github.com/swaggo/swag.(*PackagesDefinitions).ParseTypes(0xc000a12048)
        /Users/jixiuf/go/pkg/mod/github.com/swaggo/swag@v1.8.5-0.20220819205010-732c0879d89d/packages.go:110 +0xc9 fp=0xc009b3f568 sp=0xc009b3f4b8 pc=0x1e84029
github.com/swaggo/swag.(*Parser).ParseAPIMultiSearchDir(0xc000a20000, {0xc0009ae170?, 0x1?, 0x0?}, {0x216863c?, 0x7?}, 0x64)
        /Users/jixiuf/go/pkg/mod/github.com/swaggo/swag@v1.8.5-0.20220819205010-732c0879d89d/parser.go:362 +0x3bf fp=0xc009b3f6e8 sp=0xc009b3f568 pc=0x1e8853f
github.com/swaggo/swag/gen.(*Gen).Build(0xc0007981e0, 0xc000a165b0)
        /Users/jixiuf/go/pkg/mod/github.com/swaggo/swag@v1.8.5-0.20220819205010-732c0879d89d/gen/gen.go:177 +0x5c9 fp=0xc009b3f880 sp=0xc009b3f6e8 pc=0x1e99cc9
main.swagInitAction(0x11a0700?)

To Reproduce
Steps to reproduce the behavior:

  1. swag init

Expected behavior
don't panic

Your swag version
v1.8.5-0.20220819205010-732c0879d89d

Your go version
go1.18.5 darwin/amd64

Desktop (please complete the following information):

  • OS: macos
@mstrYoda
Copy link
Contributor

I think this is same as here: #1309

Fixed with the merged pr: #1310

You can use the latest stable version lower than 1.8.5.

@jixiuf jixiuf closed this as completed Aug 28, 2022
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

2 participants