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

Is it possible to automatically detect the http response codes? #10

Open
e-nikolov opened this issue Jan 1, 2022 · 1 comment
Open

Comments

@e-nikolov
Copy link
Member

No description provided.

@e-nikolov
Copy link
Member Author

e-nikolov commented Jan 3, 2022

One thing I can think of is to find the start of a function using GetFuncInfo(), and then parse the ast and count '{' and '}' to find the end of the function. Then look for all instances of http.Status* and use that to determine the status codes.

This isn't very reliable but it can work in many of the common cases and the swaggo/swag annotations can be used as an override.

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

1 participant