Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate spec from different folder than main.go #99

Closed
LuD1161 opened this issue Feb 12, 2020 · 3 comments
Closed

Can't generate spec from different folder than main.go #99

LuD1161 opened this issue Feb 12, 2020 · 3 comments

Comments

@LuD1161
Copy link

LuD1161 commented Feb 12, 2020

Problem statement

Hello,
Having this issue - No operations defined in spec!

What I've found till now

I have my package in a different directory from where I have my main.go and so swag init isn't able to generate the docs for annotations from those files.
Output of tree
image

Environment

go version: 1.13
OS: Linux

Similar to #64

@ubogdan
Copy link
Contributor

ubogdan commented Feb 12, 2020

On to of the tree run swag init -g cmd/tnbt/main.go

@LuD1161
Copy link
Author

LuD1161 commented Feb 13, 2020

@ubogdan thanks for the prompt reply. But that doesn't seem to help.
image

@LuD1161
Copy link
Author

LuD1161 commented Feb 13, 2020

Found my mistake. Forgot to add the // @Router /user/{id} [get]
Thanks @ubogdan

@LuD1161 LuD1161 closed this as completed Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants