Skip to content

Commit 721fd3e

Browse files
authored
Add comment to trim lines (github#621)
1 parent b44dee6 commit 721fd3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/github/actions.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,10 +799,11 @@ func trimContent(content string, tailLines int) (string, int) {
799799
lineCount := 0
800800
if tailLines > 0 {
801801

802-
// Count backwards to find the nth newline from the end
802+
// Count backwards to find the nth newline from the end and a total number of lines
803803
for i := len(content) - 1; i >= 0 && lineCount < tailLines; i-- {
804804
if content[i] == '\n' {
805805
lineCount++
806+
// If we have reached the tailLines, trim the content
806807
if lineCount == tailLines {
807808
content = content[i+1:]
808809
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy