How to specify which struct to use if you have several with the same name? #1807
Unanswered
diegolatorre116
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the swaggo/swag library to generate the documentation automatically in my Gin application. So, I have the following endpoint for example that, as you can see, returns models.HealthCheck, which is a struct:
The problem is that in my application I have two packages called models and both have the struct called HealthCheck, so I get this error:
ParseComment error in file /go/src/gitlab.com/main/server/app/api/handlers/healthcheck/get.go :cannot find type definition: models.HealthCheck
Besides the obvious solution of calling different structs... is there a way to tell swag which one to use? I tried aliasing it when importing but it doesn't work either.
Beta Was this translation helpful? Give feedback.
All reactions