Browse Source

protoc-gen-go: don't force space after "//" in comments (#725)

Avoid turning comments like "//////" into "// ////".
Damien Neil 7 năm trước cách đây
mục cha
commit
d7fc201936
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      protoc-gen-go/generator/generator.go

+ 1 - 1
protoc-gen-go/generator/generator.go

@@ -1295,7 +1295,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