From 2374edc6401401fcaa0d328bab38c9e3cffc9274 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Sat, 14 Jan 2012 11:57:32 -0800 Subject: [PATCH] go/doc: print only one newline between paragraphs Fixes #2595. R=golang-dev, gri CC=golang-dev https://golang.org/cl/5544068 --- src/pkg/go/doc/comment.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pkg/go/doc/comment.go b/src/pkg/go/doc/comment.go index 14809fec917..060e37bff14 100644 --- a/src/pkg/go/doc/comment.go +++ b/src/pkg/go/doc/comment.go @@ -353,12 +353,10 @@ func ToText(w io.Writer, text string, indent, preIndent string, width int) { width: width, indent: indent, } - for i, b := range blocks(text) { + for _, b := range blocks(text) { switch b.op { case opPara: - if i > 0 { - w.Write(nl) - } + // l.write will add leading newline if required for _, line := range b.lines { l.write(line) }