]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: bug fix (bug introduced with revision 3ee58453e961)
authorRobert Griesemer <gri@golang.org>
Thu, 28 Oct 2010 15:44:25 +0000 (08:44 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 28 Oct 2010 15:44:25 +0000 (08:44 -0700)
(thanks to Chris Dollin for identifying the cause)

Fixes #1237.

R=rsc
CC=golang-dev
https://golang.org/cl/2753043

src/pkg/go/doc/comment.go

index f54a672db5280fab51a17870804c0d01057561b8..9ff0bd536ae3609f5683a7a616550f89cab7952c 100644 (file)
@@ -78,10 +78,8 @@ func CommentText(comment *ast.CommentGroup) string {
        lines = lines[0:n]
 
        // Add final "" entry to get trailing newline from Join.
-       // The original loop always leaves room for one more.
        if n > 0 && lines[n-1] != "" {
-               lines = lines[0 : n+1]
-               lines[n] = ""
+               lines = append(lines, "")
        }
 
        return strings.Join(lines, "\n")