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
cmd/doc: -src not showing comments in function #28195
Comments
/cc @robpike |
The old godoc command does the same, so this is likely a property of the go/doc package. |
go/doc doesn't do anything special here. The problem is that that comments (except for doc strings) are maintained separately in the AST, and thus printing a node (such as a function node) won't know anything about internal (and non-doc) comments if they are not provided explicitly, e.g. via a go/printer.CommentedNode. |
So should this be fixed ? Because godoc also had the same behavior. |
I think it would be nice if it were fixed. I think with CommentedNode this shouldn't be too hard. |
Change https://golang.org/cl/143037 mentions this issue: |
recently added -src flag does not showing comments in function.
so, when I run
It prints
But the actual function is
The text was updated successfully, but these errors were encountered: