chore(parser/diff): rename size to length
This commit is contained in:
parent
5d5bc21447
commit
e5ae6fc223
|
@ -228,7 +228,7 @@ func reverse(s []operation) []operation {
|
||||||
|
|
||||||
// generateDiffWithContext creates a diff block with surrounding context from stdout and result.
|
// generateDiffWithContext creates a diff block with surrounding context from stdout and result.
|
||||||
func generateDiffWithContext(
|
func generateDiffWithContext(
|
||||||
stdoutLines, resultLines []string, ops []operation, maxSize int,
|
stdoutLines, resultLines []string, ops []operation, maxLength int,
|
||||||
) string {
|
) string {
|
||||||
var diffBuilder strings.Builder
|
var diffBuilder strings.Builder
|
||||||
|
|
||||||
|
@ -255,8 +255,8 @@ func generateDiffWithContext(
|
||||||
lineCount += 1
|
lineCount += 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if maxSize > 0 && diffBuilder.Len()+len(s) > maxSize {
|
if maxLength > 0 && diffBuilder.Len()+len(s) > maxLength {
|
||||||
remaining := maxSize - diffBuilder.Len()
|
remaining := maxLength - diffBuilder.Len()
|
||||||
if remaining > 0 {
|
if remaining > 0 {
|
||||||
diffBuilder.WriteString(s[:remaining])
|
diffBuilder.WriteString(s[:remaining])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user