swaggo / gin-swagger

gin middleware to automatically generate RESTful API documentation with Swagger 2.0.
MIT License
3.76k stars 270 forks source link

runtime error: negative shift amount #247

Open wthsjy opened 1 year ago

wthsjy commented 1 year ago

goroutine 1 [running]: github.com/swaggo/swag.(PackageDefinitions).evaluateConstValue(0xc000cccc80, 0xc0052cff80?, 0xc007402c00?, {0x1629a00?, 0xc00106dce0?}, {0x1627fe0, 0xc000077800}, 0x1c?) /Users/wutong/go-path/pkg/mod/github.com/swaggo/swag@v1.8.8/package.go:146 +0x101c github.com/swaggo/swag.(PackagesDefinitions).EvaluateConstValue(0xc00519d698?, 0xc000cccc80, 0xc006458640, 0x0) /Users/wutong/go-path/pkg/mod/github.com/swaggo/swag@v1.8.8/packages.go:282 +0x19d github.com/swaggo/swag.(PackagesDefinitions).evaluateAllConstVariables(...) /Users/wutong/go-path/pkg/mod/github.com/swaggo/swag@v1.8.8/packages.go:265 github.com/swaggo/swag.(PackagesDefinitions).ParseTypes(0xc000077800) /Users/wutong/go-path/pkg/mod/github.com/swaggo/swag@v1.8.8/packages.go:110 +0x254 github.com/swaggo/swag.(Parser).ParseAPIMultiSearchDir(0xc0001f0000, {0xc0001ea100?, 0x1?, 0x0?}, {0x155d9f9?, 0x7?}, 0x64) /Users/wutong/go-path/pkg/mod/github.com/swaggo/swag@v1.8.8/parser.go:375 +0x3bf github.com/swaggo/swag/gen.(Gen).Build(0xc0001b1a10, 0xc0001ac2a0) /Users/wutong/go-path/pkg/mod/github.com/swaggo/swag@v1.8.8/gen/gen.go:182 +0x637 main.initAction(0xc0001d6780?) /Users/wutong/go-path/pkg/mod/github.com/swaggo/swag@v1.8.8/cmd/swag/main.go:158 +0x7bd github.com/urfave/cli/v2.(Command).Run(0xc000183560, 0xc0001c8540) /Users/wutong/go-path/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x5bb github.com/urfave/cli/v2.(App).RunContext(0xc0001c4340, {0x162a818?, 0xc00002a0a8}, {0xc0000201b0, 0x3, 0x3}) /Users/wutong/go-path/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0xb48 github.com/urfave/cli/v2.(*App).Run(...) /Users/wutong/go-path/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224 main.main() /Users/wutong/go-path/pkg/mod/github.com/swaggo/swag@v1.8.8/cmd/swag/main.go:229 +0x55d

ahakkila commented 1 year ago

There's an issue in swaggo/swag that has been fixed in master and will eventually be released https://github.com/swaggo/swag/issues/1392