golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.15k stars 17.46k forks source link

x/tools/cmd/godoc: show entities before cross-references #21686

Open bcmills opened 6 years ago

bcmills commented 6 years ago

(A follow-on from #21685.)

Arguably the most useful godoc results are packages, followed by entities defined within those packages (types, variables, functions, interfaces, and methods). Cross-references are sometimes helpful, but rarely what I'm looking for when I'm searching golang.org.

For example, if I search for rand, odds are good I'm looking for the package documentation for either math/rand or crypto/rand. Unfortunately, at the moment there are so many cross-references that the latter result doesn't even appear above the fold.¹

¹ vaxrdmhgvxp

gopherbot commented 6 years ago

Change https://golang.org/cl/129135 mentions this issue: godoc: generate TOC from server-side for search page