Avoid turning comments like "//////" into "// ////". Change-Id: I88a2d0eef01c0b577a2da392fd81df202db13258 Cherry-Pick: github.com/golang/protobuf@d7fc20193620986259ffb1f9b9da752114ee14a4 Original-Author: Damien Neil <neild@users.noreply.github.com> Reviewed-on: https://go-review.googlesource.com/c/151426 Reviewed-by: Damien Neil <dneil@google.com>
@@ -1296,7 +1296,7 @@ func (g *Generator) makeComments(path string) (string, bool) {
w := new(bytes.Buffer)
nl := ""
for _, line := range strings.Split(strings.TrimSuffix(loc.GetLeadingComments(), "\n"), "\n") {
- fmt.Fprintf(w, "%s// %s", nl, strings.TrimPrefix(line, " "))
+ fmt.Fprintf(w, "%s//%s", nl, line)
nl = "\n"
}
return w.String(), true