Procházet zdrojové kódy

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

Avoid turning comments like "//////" into "// ////".
Damien Neil před 7 roky
rodič
revize
d7fc201936
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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