• Joe Tsai's avatar
    go/printer: forbid empty line before first comment in block · 08f19bbd
    Joe Tsai authored
    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: 's avatarRobert Griesemer <gri@golang.org>
    08f19bbd
Name
Last commit
Last update
..
android Loading commit data...
arm Loading commit data...
cgo Loading commit data...
chrome/gophertool Loading commit data...
git Loading commit data...
ios Loading commit data...
linkcheck Loading commit data...
nacl Loading commit data...
sortac Loading commit data...
swig Loading commit data...
trace Loading commit data...
benchcmp Loading commit data...
editors Loading commit data...