swag
swag copied to clipboard
var-declared function's doc not generated
Describe the bug
Currently function declared by var is ignored. But it indeed is a function, which might act as an API handler. The example below shows the case.
package main
func f() {}
// GetSth godoc
var GetSth = f
Furthermore, any variable pointing directly or indirectly to a function should not be ignored, and it's swag comment should be handled correctly.
package main
func f() {}
// F1 godoc
var F1 = f
// F2 godoc
var F2 = f1
// F3 godoc
var F3 = f2
To Reproduce see above
Expected behavior
expect swag would generate docs realted to function declared by var
Screenshots If applicable, add screenshots to help explain your problem.
Your swag version e.g. 1.8.12
Your go version e.g. 1.19
Desktop (please complete the following information):
- OS: mac
- Browser: firefox
- Version: [e.g. 22]
Additional context no more context
@ubogdan Hi, please take a look at this issue, if it is meaningful, there's a pr need review