mirror of
https://github.com/golang/go
synced 2024-11-24 04:30:14 -07:00
cmd/doc: fix repeated header bug added in previous CL
One too many lines was deleted, and it would print a header multiple times. Add a test. Change-Id: I4906b454dbb66193d515ffacf43849ffdc2dede6 Reviewed-on: https://go-review.googlesource.com/c/142937 Reviewed-by: Ralph Corderoy <ralph@inputplus.co.uk> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
101a677ebf
commit
a2381f5966
@ -733,6 +733,9 @@ func TestDoc(t *testing.T) {
|
||||
failed = true
|
||||
}
|
||||
}
|
||||
if bytes.Count(output, []byte("TYPES\n")) > 1 {
|
||||
t.Fatalf("%s: repeating headers", test.name)
|
||||
}
|
||||
if failed {
|
||||
t.Logf("\n%s", output)
|
||||
}
|
||||
|
@ -426,6 +426,7 @@ func (pkg *Package) allDoc() {
|
||||
printHdr := func(s string) {
|
||||
if hdr != s {
|
||||
pkg.Printf("\n%s\n\n", s)
|
||||
hdr = s
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user