1
0
mirror of https://github.com/golang/go synced 2024-11-19 00:54:42 -07:00

godoc: bug fix (bug introduced with revision 3ee58453e961)

(thanks to Chris Dollin for identifying the cause)

Fixes #1237.

R=rsc
CC=golang-dev
https://golang.org/cl/2753043
This commit is contained in:
Robert Griesemer 2010-10-28 08:44:25 -07:00
parent e79ebb008f
commit 12be168b4b

View 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")