From 08f19bbde1b01227fdc2fa2d326e4029bb74dd96 Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Thu, 19 Oct 2017 17:31:31 -0700 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/unicode/example_test.go | 1 - 1 file changed, 1 deletion(-) (limited to 'src/unicode/example_test.go') diff --git a/src/unicode/example_test.go b/src/unicode/example_test.go index 50c5b18a48..a60dae4458 100644 --- a/src/unicode/example_test.go +++ b/src/unicode/example_test.go @@ -12,7 +12,6 @@ import ( // Functions starting with "Is" can be used to inspect which table of range a // rune belongs to. Note that runes may fit into more than one range. func Example_is() { - // constant with mixed type runes const mixed = "\b5Ὂg̀9! ℃ᾭG" for _, c := range mixed { -- cgit v1.3