1
0
mirror of https://github.com/golang/go synced 2024-11-19 18:54:41 -07:00
go/misc
Joe Tsai 08f19bbde1 go/printer: forbid empty line before first comment in block
To improve readability when exported fields are removed,
forbid the printer from emitting an empty line before the first comment
in a const, var, or type block.
Also, when printing the "Has filtered or unexported fields." message,
add an empty line before it to separate the message from the struct
or interfact contents.

Before the change:
<<<
type NamedArg struct {

        // Name is the name of the parameter placeholder.
        //
        // If empty, the ordinal position in the argument list will be
        // used.
        //
        // Name must omit any symbol prefix.
        Name string

        // Value is the value of the parameter.
        // It may be assigned the same value types as the query
        // arguments.
        Value interface{}
        // contains filtered or unexported fields
}
>>>

After the change:
<<<
type NamedArg struct {
        // Name is the name of the parameter placeholder.
        //
        // If empty, the ordinal position in the argument list will be
        // used.
        //
        // Name must omit any symbol prefix.
        Name string

        // Value is the value of the parameter.
        // It may be assigned the same value types as the query
        // arguments.
        Value interface{}

        // contains filtered or unexported fields
}
>>>

Fixes #18264

Change-Id: I9fe17ca39cf92fcdfea55064bd2eaa784ce48c88
Reviewed-on: https://go-review.googlesource.com/71990
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-11-02 18:17:22 +00:00
..
android misc/android: don't let the Android exec wrapper hang indefinitely 2017-05-01 22:31:15 +00:00
arm
cgo go/printer: forbid empty line before first comment in block 2017-11-02 18:17:22 +00:00
chrome/gophertool
git
ios misc/ios: always kill lldb process when it hangs 2017-10-03 14:21:35 +00:00
linkcheck
nacl cmd/cover: preserve compiler directives in floating comments 2017-10-16 23:38:38 +00:00
sortac
swig
trace misc/trace: update trace-viewer 2017-08-25 15:50:29 +00:00
benchcmp
editors