Open chirino opened 2 months ago
swag init --parseDependency -g ./main.go -o .
You need to add option --parseDependency
.
I have the same problem - but it gives me an error saying the external package is missing when it's in both the go.mod
and go.sum
running swag init --parseDependency
produces:
missing go.sum entry for module providing package github.com/hcpd-solutions/pki; to add:
go mod download github.com/hcpd-solutions/pki
missing go.sum entry for module providing package github.com/hcpd-solutions/pki; to add:
go mod download github.com/hcpd-solutions/pki
Describe the bug Swag fails to load type in external package.
To Reproduce
I created a super small project to illustrate the error:
Expected behavior no errors should occur.
Screenshots
Your swag version v1.16.3
Your go version go1.22.