Refactor out single common line

This commit is contained in:
Collin Wright 2023-03-23 22:46:32 -04:00
parent 97fe38d54b
commit 06f14762f3
1 changed files with 1 additions and 2 deletions

View File

@ -151,15 +151,14 @@ func (g *CommentGroup) Text() string {
n++
}
}
lines = lines[0:n]
} else {
// Remove trailing blank lines
n = len(lines)
for n > 0 && lines[n-1] == "" {
n--
}
lines = lines[0:n]
}
lines = lines[0:n]
// Add final "" entry to get trailing newline from Join.
if n > 0 && lines[n-1] != "" {