• 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
..
syntax Loading commit data...
testdata Loading commit data...
all_test.go Loading commit data...
backtrack.go Loading commit data...
example_test.go Loading commit data...
exec.go Loading commit data...
exec2_test.go Loading commit data...
exec_test.go Loading commit data...
find_test.go Loading commit data...
onepass.go Loading commit data...
onepass_test.go Loading commit data...
regexp.go Loading commit data...