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
x/tools/godoc: unexported fields are displayed in exported variable initializers #22803
Comments
@robpike, @griesemer, any opinions? Is this expected? |
I think this is expected (I don't think we have special code to filter those fields, but I haven't checked); when there's an initialization expression we simply print that expression. That is not to say that this is correct (or wrong for that matter). |
It doesn't bother me much, although I can understand why some would be distracted. |
The proposal-review group is fine with unexported field initializations being replaced with "..." just as for unexported fields in type definitions. We don't anticipate working on it ourselves. |
I am thinking of working on this. This is my first time tinkering with ASTs, so I would need a little guidance. Just to be clear, the fix needs to be done in the Initially, I started making changes in the
Does this look like the correct approach ? |
@agnivade Your suggestions sound reasonable and match what we do for struct fields. Please send CLs directly to me for review. Thanks. |
Perfect. Thanks ! |
Change https://golang.org/cl/106395 mentions this issue: |
What did you do?
https://godoc.org/github.com/opennota/rwc
What did you expect to see?
godoc doesn't show unexported fields.
What did you see instead?
godoc for the
DefaultConstructor
variable shows unexported fields:The text was updated successfully, but these errors were encountered: