swaggo / swag

Automatically generate RESTful API documentation with Swagger 2.0 for Go.
MIT License
10.24k stars 1.17k forks source link

warning: failed to get package name in dir: ./, error: execute go list command, exit status 1, stdout:, stderr:no Go files in #1811

Open sarkis1231 opened 2 months ago

sarkis1231 commented 2 months ago

Getting this warning "warning: failed to get package name in dir: ./, error: execute go list command, exit status 1, stdout:, stderr:no Go files in go-lang/swagger-chi". But my folder structure looks good and the command is correct I have tried to downgrade go version to 1.22.0 the warning disappeared

Expected behavior I expect to not see the warning

Screenshots Screenshot 2024-05-23 at 2 57 54 AM

Your swag version e.g. 1.16.3

Your go version e.g. 1.22.1

Desktop (please complete the following information):

pot-code commented 1 month ago

so i added the -q flag to supress logs

bobsongplus commented 1 month ago

If you don't specify the directory, swag will search the current directory. I think the behavior is correct and the message is a warning that doesn't affect swag generation.

sarkis1231 commented 1 month ago

-q

swag init -g cmd/server.go --outputTypes go,yaml I have specified