Swagger comments in Go files are not recursively parsed by Swaggo
itoqsky opened this issue · comments
Issue Description
Swaggo fails to recursively parse Swagger comments in Go files when using the swag init
command with multiple directories and the --parseDependency
and --parseInternal
flags. Only the comments in the main file specified with the -g
flag are parsed, while the comments in other files within the specified directories are not considered.
commands I have run:
swag init -d cmd/app/ -g main.go --parseDependency --parseInternal
swag init -d cmd/app/,internal/transport/http/v1 -g main.go --parseDependency --parseInternal
All the commands above produces the same result
Files that contain swaggo comments are internal/transport/http/v1/auth.go, internal/transport/http/v1/trip.go, and cmd/app/main.go
Structure
Comments in one of the files other than cmd/app/main.go
swag version
e.g. 1.8.12
go version
e.g. 1.20.2
OS
OSX