mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/doc: stop showing interface methods while matching symbols
Fixes #31961 Change-Id: I9db9ecfd2f8ca7cf51df4413a6e0d66de5da7043 Reviewed-on: https://go-review.googlesource.com/c/go/+/178457 Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
e2970a4591
commit
65ef999d52
2 changed files with 18 additions and 2 deletions
|
|
@ -914,8 +914,8 @@ func trimUnexportedFields(fields *ast.FieldList, isInterface bool) *ast.FieldLis
|
|||
}
|
||||
|
||||
// printMethodDoc prints the docs for matches of symbol.method.
|
||||
// If symbol is empty, it prints all methods that match the name.
|
||||
// It reports whether it found any methods.
|
||||
// If symbol is empty, it prints all methods for any concrete type
|
||||
// that match the name. It reports whether it found any methods.
|
||||
func (pkg *Package) printMethodDoc(symbol, method string) bool {
|
||||
defer pkg.flush()
|
||||
types := pkg.findTypes(symbol)
|
||||
|
|
@ -937,6 +937,9 @@ func (pkg *Package) printMethodDoc(symbol, method string) bool {
|
|||
}
|
||||
continue
|
||||
}
|
||||
if symbol == "" {
|
||||
continue
|
||||
}
|
||||
// Type may be an interface. The go/doc package does not attach
|
||||
// an interface's methods to the doc.Type. We need to dig around.
|
||||
spec := pkg.findTypeSpec(typ.Decl, typ.Name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue