Commit cf3134a0 authored by Rob Pike's avatar Rob Pike

cmd/doc: the builtin package should always show unexported symbols

Trivial fix: set unexported=true for builtin.
Godoc itself has a similar hack.

Fixes #12541

Change-Id: Ib701f867d117931eb6ec6de223941b52eb6cd4a7
Reviewed-on: https://go-review.googlesource.com/14441Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent c12e38aa
......@@ -87,6 +87,7 @@ func do(writer io.Writer, flagSet *flag.FlagSet, args []string) (err error) {
buildPackage, userPath, symbol := parseArgs(flagSet.Args())
symbol, method := parseSymbol(symbol)
pkg := parsePackage(writer, buildPackage, userPath)
defer func() {
pkg.flush()
e := recover()
......@@ -100,6 +101,13 @@ func do(writer io.Writer, flagSet *flag.FlagSet, args []string) (err error) {
}
panic(e)
}()
// The builtin package needs special treatment: its symbols are lower
// case but we want to see them, always.
if pkg.build.ImportPath == "builtin" {
unexported = true
}
switch {
case symbol == "":
pkg.packageDoc()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment