Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit721fd3e

Browse files
authored
Add comment to trim lines (#621)
1 parentb44dee6 commit721fd3e

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
iftailLines>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
fori:=len(content)-1;i>=0&&lineCount<tailLines;i-- {
804804
ifcontent[i]=='\n' {
805805
lineCount++
806+
// If we have reached the tailLines, trim the content
806807
iflineCount==tailLines {
807808
content=content[i+1:]
808809
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp