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

var-declared function's doc not generated #1656

Closed
book987 opened this issue Aug 24, 2023 · 1 comment
Closed

var-declared function's doc not generated #1656

book987 opened this issue Aug 24, 2023 · 1 comment

Comments

@book987
Copy link
Contributor

book987 commented Aug 24, 2023

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

@book987
Copy link
Contributor Author

book987 commented Sep 15, 2023

@ubogdan Hi, please take a look at this issue, if it is meaningful, there's a pr need review

@book987 book987 closed this as completed Oct 24, 2024
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