1
0
mirror of https://github.com/golang/go synced 2024-10-02 16:18:38 -06:00
go/misc/cgo
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
..
errors misc/cgo/errors: don't pass -C to compiler 2017-09-14 04:02:01 +00:00
fortran *.bash: always use the same string equality operator 2017-03-14 21:46:31 +00:00
gmp all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
life test/run: use go tool compile + link instead of go run when possible 2017-10-31 13:21:05 +00:00
nocgo cmd/ld: really import runtime/cgo for external link 2014-05-20 21:36:50 -07:00
stdio test/run: use go tool compile + link instead of go run when possible 2017-10-31 13:21:05 +00:00
test go/printer: forbid empty line before first comment in block 2017-11-02 18:17:22 +00:00
testasan runtime: more flexible heap memory mapping on 64-bits 2013-06-12 18:47:16 +04:00
testcarchive misc/cgo/testcarchive: use -no-pie where needed 2017-10-11 21:01:45 +00:00
testcshared misc/cgo/testcshared: don't overwrite cc in parallel runs 2017-10-09 05:31:01 +00:00
testgodefs cmd/cgo: add -srcdir option 2016-10-30 19:14:08 +00:00
testplugin cmd/link, plugin: always encode path 2017-10-26 15:08:37 +00:00
testsanitizers misc/cgo/testsanitizers: convert test.bash to Go 2017-08-17 15:05:08 +00:00
testshared cmd/go: switch to entirely content-based staleness determination 2017-10-31 13:19:38 +00:00
testsigfwd misc/cgo/testsigfwd: add missing return statement 2016-08-30 21:44:14 +00:00
testso cmd/dist: convert testso test into Go 2015-06-12 04:33:50 +00:00
testsovar misc/cgo/testsovar: needs the extern keyword to export variables on non-windows platforms 2015-07-21 18:10:57 +00:00
testtls all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00