From ac98e977c392885c702515f4899b8f2a2c873870 Mon Sep 17 00:00:00 2001 From: Jesse Simpson Date: Tue, 18 Mar 2025 20:30:19 -0400 Subject: [PATCH] refactor: switch to while loop instead of for to reduce unnecessary variables Signed-off-by: Jesse Simpson --- pkg/engine/engine.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index 26f80a2f0..fee26490f 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -375,12 +375,7 @@ func reformatExecErrorMsg(filename string, err error) error { } current := err fileLocations := []TraceableError{} - maxIterations := 100 - for i := 0; i < maxIterations && current != nil; i++ { - if i == maxIterations-1 { - return err - } - + for current != nil { var traceable TraceableError if matches := execErrFmt.FindStringSubmatch(current.Error()); matches != nil { templateName := matches[execErrFmt.SubexpIndex("templateName")]