Skip to content

Commit 74a060a

Browse files
committed
Rename a local variable
1 parent 0b6c32c commit 74a060a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

hooks/jsonnet-fmt-hook/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func hasTestOpt(opts []string) bool {
6666
func summarizeDiff(diffs []diffmatchpatch.Diff) *FileDiff {
6767
var builder strings.Builder
6868
var err error
69-
var lastLineBreak bool
69+
var endWithLineBreak bool
7070
var fileDiff FileDiff
7171

7272
writeString := func(builder *strings.Builder, s string) {
@@ -96,7 +96,7 @@ func summarizeDiff(diffs []diffmatchpatch.Diff) *FileDiff {
9696
fileDiff.numDelete += len(text)
9797
case diffmatchpatch.DiffEqual:
9898
var showHead, showTail bool
99-
lastLineBreak = text[len(text)-1:] == "\n"
99+
endWithLineBreak = text[len(text)-1:] == "\n"
100100
writeLineCount := min(maxShowLine, len(lines))
101101

102102
if i == 0 {
@@ -127,7 +127,7 @@ func summarizeDiff(diffs []diffmatchpatch.Diff) *FileDiff {
127127
writeString(&builder, omissionText)
128128
}
129129
if showTail {
130-
if !showHead && !lastLineBreak {
130+
if !showHead && !endWithLineBreak {
131131
writeString(&builder, omissionText)
132132
}
133133
writeString(&builder, strings.Join(lines[len(lines)-writeLineCount:], "\n"))

0 commit comments

Comments
 (0)