1
0
mirror of https://github.com/golang/go synced 2024-10-03 03:11:21 -06:00
go/src/regexp
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
..
syntax go/printer: forbid empty line before first comment in block 2017-11-02 18:17:22 +00:00
testdata regexp/syntax: fix factoring of common prefixes in alternations 2016-01-08 16:41:46 +00:00
all_test.go regexp: speed up QuoteMeta with a lookup table 2017-04-28 06:43:14 +00:00
backtrack.go regexp: make (*bitState).push inlinable 2017-09-25 19:34:26 +00:00
example_test.go regexp: examples for Regexp.Expand and Regexp.ExpandString functions 2017-08-28 15:34:19 +00:00
exec2_test.go
exec_test.go all: revert "all: prefer strings.IndexByte over strings.Index" 2017-10-05 23:19:10 +00:00
exec.go all: unindent some if bodies by exiting early 2017-10-31 20:07:46 +00:00
find_test.go
onepass_test.go regexp: reduce allocations at onePassCopy 2017-03-28 17:58:10 +00:00
onepass.go regexp: remove redundant break 2017-04-25 15:00:06 +00:00
regexp.go all: revert "all: prefer strings.IndexByte over strings.Index" 2017-10-05 23:19:10 +00:00