]> Cypherpunks repositories - gostls13.git/commit
cmd/doc: show variables of unexported types for -all
authorAgniva De Sarker <agnivade@yahoo.co.in>
Mon, 11 Nov 2019 19:22:57 +0000 (00:52 +0530)
committerAgniva De Sarker <agniva.quicksilver@gmail.com>
Tue, 12 Nov 2019 04:09:39 +0000 (04:09 +0000)
commit72e043e48bf47ce03229b011d2468f46081055ad
tree0b9f91a2ead94f07214a9997200fbf79df7b95a8
parentc2edcf4b1253fdebc13df8a25979904c3ef01c66
cmd/doc: show variables of unexported types for -all

We use the typedValue map to prevent showing typed variables
and constants from appearing in the VARIABLES/CONSTANTS section
because they will be anyways shown in the TYPES section
for that type.

However, when a type is unexported, but the variable is exported,
then unconditionally setting it to true in the map suppresses it
from being shown in the VARIABLES section. Thus, we set the
variable or constant in the typedValue map only when
the type name is exported.

Fixes #31067

Change-Id: Id3ec4b313c9ea7e3ce6fe279680d56f65451719f
Reviewed-on: https://go-review.googlesource.com/c/go/+/206129
Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/doc/doc_test.go
src/cmd/doc/pkg.go
src/cmd/doc/testdata/pkg.go