]> Cypherpunks repositories - gostls13.git/commit
cmd/doc: fix strange indentation artifacts with unexported fields
authorJoe Tsai <joetsai@digital-static.net>
Sat, 24 Oct 2015 00:09:39 +0000 (17:09 -0700)
committerRob Pike <r@golang.org>
Tue, 17 Nov 2015 20:51:19 +0000 (20:51 +0000)
commit07d48993f257a6536d83555bb8cc9daffa07dd56
tree170590cc60babe130029b7013ae9ed6ec4675ac4
parent90e26f52c6d2012d293ebfe8d272f03462213045
cmd/doc: fix strange indentation artifacts with unexported fields

The NamePos value was not being set, and would default to a value
of zero. This would cause the printing logic to get confused as
to where exactly to place the "Has unexported fields" string.

A trivial package changes from

<
type A struct {
A int // A
B int
// B
// Has unexported fields.
}
>

to

<
type A struct {
A int // A
B int // B
// Has unexported fields.
}
>

Fixes #12971

Change-Id: I53b7799a1f1c0ad7dcaddff83d9aaeb1d6b7823e
Reviewed-on: https://go-review.googlesource.com/16286
Run-TryBot: Joe Tsai <joetsai@digital-static.net>
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/pkg.go