Skip to content

Commit d7fc201

Browse files
authored
protoc-gen-go: don't force space after "//" in comments (#725)
Avoid turning comments like "//////" into "// ////".
1 parent 7be3631 commit d7fc201

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

protoc-gen-go/generator/generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ func (g *Generator) makeComments(path string) (string, bool) {
12951295
w := new(bytes.Buffer)
12961296
nl := ""
12971297
for _, line := range strings.Split(strings.TrimSuffix(loc.GetLeadingComments(), "\n"), "\n") {
1298-
fmt.Fprintf(w, "%s// %s", nl, strings.TrimPrefix(line, " "))
1298+
fmt.Fprintf(w, "%s//%s", nl, line)
12991299
nl = "\n"
13001300
}
13011301
return w.String(), true

0 commit comments

Comments
 (0)