• 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
..
errors Loading commit data...
fortran Loading commit data...
gmp Loading commit data...
life Loading commit data...
nocgo Loading commit data...
stdio Loading commit data...
test Loading commit data...
testasan Loading commit data...
testcarchive Loading commit data...
testcshared Loading commit data...
testgodefs Loading commit data...
testplugin Loading commit data...
testsanitizers Loading commit data...
testshared Loading commit data...
testsigfwd Loading commit data...
testso Loading commit data...
testsovar Loading commit data...
testtls Loading commit data...