golang/go

cmd/go: doc: doesn't show embedded struct's methods

Open

#69,596 创建于 2024年9月23日

在 GitHub 查看
 (10 评论) (0 反应) (0 负责人)Go (19,008 fork)batch import
GoCommandNeedsInvestigationhelp wanted

仓库指标

Star
 (133,883 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Proposal Details

Hi! I was recently using a new GO module in my project. There was code like this:

type (
   A struct {}
   B struct { *A }
)

func (*A) Foo() {}

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 said doc: no method or field B.Foo in package.

I suppose, that because call like this is 100% possible &B{}.Foo(), above go doc call should return documentation for Foo

贡献者指南