]> Cypherpunks repositories - gostls13.git/commit
cmd/doc: show page for the requested object
authorMichael Matloob <matloob@golang.org>
Mon, 19 May 2025 19:31:37 +0000 (15:31 -0400)
committerMichael Matloob <matloob@golang.org>
Tue, 20 May 2025 20:30:28 +0000 (13:30 -0700)
commit1972493904b41a34e35a1f62b18f5d91d84a26bd
treeaa2674cf5efc9cd929936ce70fb5a46d88022a1a
parent113b25774ed8d1d915ae4e1adf9222865ccb0695
cmd/doc: show page for the requested object

This fixes a bug where we start pkgsite for every requested object,
rather than the one that we would have printed the documentation for.
To make things simple, we'll run the logic that prints the
documentation, but with an io.Discard writer. Then we can tell if the
documentation was found based on the return values of those functions.

For #68106

Change-Id: Ibf2ab1720f381d7214fc9239b9c2e915c91f7f7b
Reviewed-on: https://go-review.googlesource.com/c/go/+/674555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
src/cmd/doc/main.go