mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/doc: print BUGs after package docs
Was otherwise absent unless bound to an exported symbol, as in the BUG with strings.Title. Fixes #10781. Change-Id: I1543137073a9dee9e546bc9d648ca54fc9632dde Reviewed-on: https://go-review.googlesource.com/9899 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
6f2c0f1585
commit
1e26df40fa
1 changed files with 13 additions and 0 deletions
|
|
@ -190,6 +190,7 @@ func (pkg *Package) packageDoc() {
|
|||
pkg.valueSummary(pkg.doc.Vars)
|
||||
pkg.funcSummary(pkg.doc.Funcs)
|
||||
pkg.typeSummary()
|
||||
pkg.bugs()
|
||||
}
|
||||
|
||||
// packageClause prints the package clause.
|
||||
|
|
@ -253,6 +254,18 @@ func (pkg *Package) typeSummary() {
|
|||
}
|
||||
}
|
||||
|
||||
// bugs prints the BUGS information for the package.
|
||||
// TODO: Provide access to TODOs and NOTEs as well (very noisy so off by default)?
|
||||
func (pkg *Package) bugs() {
|
||||
if pkg.doc.Notes["BUG"] == nil {
|
||||
return
|
||||
}
|
||||
pkg.Printf("\n")
|
||||
for _, note := range pkg.doc.Notes["BUG"] {
|
||||
pkg.Printf("%s: %v\n", "BUG", note.Body)
|
||||
}
|
||||
}
|
||||
|
||||
// findValues finds the doc.Values that describe the symbol.
|
||||
func (pkg *Package) findValues(symbol string, docValues []*doc.Value) (values []*doc.Value) {
|
||||
for _, value := range docValues {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue