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:
parent
e79ebb008f
commit
12be168b4b
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user