-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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/go: doc: doesn't show embedded struct's methods #69596
Comments
#1000 seems similar but it was in 2010 and there was a regression since that (?) |
As #1000 was ever fixed, so this should not be a proposal? |
@zigo101 so a bug? Could you change pls? Or should i open another issue as a bug? |
I haven't verified this, but as reported it's just a bug. This issue is fine as is. Thanks. |
I investigated this a bit and found that this change in behavior, hiding methods from exported embeds, was intentional in response to #2791 . So I don't think this qualifies as a bug? Background info from my investigation: The current src/go/doc package intentionally hides methods from exported embeds by default. It does include unexported embedded methods, for instance: type (
a struct{}
B struct { *a }
)
func (*a) Foo() {}
To revert back to showing exported embedded methods too, the |
The design difference here looks unnecessary. |
Proposal Details
Hi!
I was recently using a new GO module in my project.
There was code like this:
Tybe B however was a large struct with many methods and exported fields.
I had a code example that used method
Foo
and I just wanted to know more about i.I used
go doc B.Foo
but it saiddoc: no method or field B.Foo in package
.I suppose, that because call like this is 100% possible
&B{}.Foo()
, abovego doc
call should return documentation forFoo
The text was updated successfully, but these errors were encountered: