swag: swag init --parseDependency is throwing negative shift amount or interface conversion error

Describe the bug Recently when I tried to use swag init --parseDependency, I got 2 different errors - “runtime error: negative shift amount” and “interface conversion: interface {} is a string, not int”. Both the errors are throwing at .evaluateConstValue in package.go

I tried creating a separate small project and while initializing I got the similar issue but intermittently (not getting repeatedly)

To Reproduce Steps to reproduce the behavior:

  1. Create a package that has a function that calls interface
   For Example: func BindContextandResetBindContext(c echo.Context, i interface{}) error {
}
  1. Use this package in swagger params For Example: @Failure 400 {object} httputil.HTTPError Above function is implemented in httputil module,

Screenshots image

image

Your swag version v1.8.1

Your go version 1.19.1

Desktop (please complete the following information):

  • OS: Windows

Additional context I am currently using Swaggo with Echo Framework

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 7
  • Comments: 21 (9 by maintainers)

Most upvoted comments

I confirm 1.8.8 throws me described error and downgrading to v1.8.7 solves it

same here

swag version: v1.8.8 go version: 1.19.4

I solve it by downgrading swag to 1.8.7

v1.8.9 released.

I had the same issue with 1.8.8 on macOS but with upgrading to swag-1.8.9-rc3 it works now!

I had the same issue with 1.8.8 on Windows but with upgrading to swag-1.8.9-rc3 it works now!