aboutsummaryrefslogtreecommitdiff
path: root/src/image
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2017-10-19 17:31:31 -0700
committerJoe Tsai <joetsai@google.com>2017-11-02 18:17:22 +0000
commit08f19bbde1b01227fdc2fa2d326e4029bb74dd96 (patch)
tree47677662e92d111529f1f66d9731bf35c18b6bd0 /src/image
parent8585f9fdb176893992bc8096ff595148b14b1795 (diff)
downloadgo-08f19bbde1b01227fdc2fa2d326e4029bb74dd96.tar.gz
go-08f19bbde1b01227fdc2fa2d326e4029bb74dd96.zip
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>
Diffstat (limited to 'src/image')
-rw-r--r--src/image/internal/imageutil/impl.go2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/image/internal/imageutil/impl.go b/src/image/internal/imageutil/impl.go
index cfd5047879..4c6de742da 100644
--- a/src/image/internal/imageutil/impl.go
+++ b/src/image/internal/imageutil/impl.go
@@ -42,7 +42,6 @@ func DrawYCbCr(dst *image.RGBA, r image.Rectangle, src *image.YCbCr, sp image.Po
ci := (sy-src.Rect.Min.Y)*src.CStride + (sp.X - src.Rect.Min.X)
for x := x0; x != x1; x, yi, ci = x+4, yi+1, ci+1 {
-
// This is an inline version of image/color/ycbcr.go's func YCbCrToRGB.
yy1 := int32(src.Y[yi]) * 0x10101
cb1 := int32(src.Cb[ci]) - 128
@@ -212,7 +211,6 @@ func DrawYCbCr(dst *image.RGBA, r image.Rectangle, src *image.YCbCr, sp image.Po
ci := (sy/2-src.Rect.Min.Y/2)*src.CStride + (sp.X - src.Rect.Min.X)
for x := x0; x != x1; x, yi, ci = x+4, yi+1, ci+1 {
-
// This is an inline version of image/color/ycbcr.go's func YCbCrToRGB.
yy1 := int32(src.Y[yi]) * 0x10101
cb1 := int32(src.Cb[ci]) - 128