• Joe Tsai's avatar
    cmd/doc: fix strange indentation artifacts with unexported fields · 07d48993
    Joe Tsai authored
    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: 's avatarRob Pike <r@golang.org>
    07d48993
pkg.go 16.4 KB