]> Cypherpunks repositories - gostls13.git/commit
cmd/doc: show the package clause always
authorAgniva De Sarker <agnivade@yahoo.co.in>
Mon, 11 Nov 2019 15:46:18 +0000 (21:16 +0530)
committerAgniva De Sarker <agniva.quicksilver@gmail.com>
Tue, 12 Nov 2019 05:24:00 +0000 (05:24 +0000)
commitd22b5735e74c1e5905d1574853cb9a9f48da1afe
treee3e6beba08546bbc54bfec50de345e4a54519e84
parent194ae3236d81cf16dc39b955efc1b9202b59d067
cmd/doc: show the package clause always

If no writes to the package buffer happen, then the package clause
does not get printed. This is a bug for cases where a file just contains
the package clause.

We fix this by separating the printing of package clause to a new
function and calling it from (*pkgBuffer).Write as well as (*Package).flush.

Updates #31457

Change-Id: Ia3bd0ea3963274c460a45d1e37fafc6ee0a197f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/206128
Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/doc/doc_test.go
src/cmd/doc/pkg.go
src/cmd/doc/testdata/nested/empty/empty.go [new file with mode: 0644]