• 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
..
utf16 Loading commit data...
utf8 Loading commit data...
casetables.go Loading commit data...
digit.go Loading commit data...
digit_test.go Loading commit data...
example_test.go Loading commit data...
graphic.go Loading commit data...
graphic_test.go Loading commit data...
letter.go Loading commit data...
letter_test.go Loading commit data...
maketables.go Loading commit data...
script_test.go Loading commit data...
tables.go Loading commit data...