From 4911ad8ff1dbd35419abb9699f63244e3a71294b Mon Sep 17 00:00:00 2001 From: Nikhita Raghunath Date: Thu, 25 Oct 2018 16:08:11 +0530 Subject: [PATCH] Remove trailing whitespace in proto generator --- .../code-generator/cmd/go-to-protobuf/protobuf/generator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go b/staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go index 0e7a7d8ec35..49e8297dbd0 100644 --- a/staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go +++ b/staging/src/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go @@ -724,6 +724,10 @@ func genComment(out io.Writer, lines []string, indent string) { lines = lines[:l-1] } for _, c := range lines { + if len(c) == 0 { + fmt.Fprintf(out, "%s//\n", indent) // avoid trailing whitespace + continue + } fmt.Fprintf(out, "%s// %s\n", indent, c) } }