refactor: reduce flow-control operations

Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
This commit is contained in:
Jesse Simpson 2025-03-18 21:11:25 -04:00
parent 48922e21d1
commit 868cdc261f
No known key found for this signature in database
GPG key ID: 237495C89AB0AAFC

View file

@ -397,14 +397,9 @@ func reformatExecErrorMsg(filename string, err error) error {
} else {
return err
}
if len(fileLocations) > 0 {
lastErr := fileLocations[len(fileLocations)-1]
if lastErr == traceable {
current = errors.Unwrap(current)
continue
}
if len(fileLocations) == 0 || fileLocations[len(fileLocations)-1] != traceable {
fileLocations = append(fileLocations, traceable)
}
fileLocations = append(fileLocations, traceable)
current = errors.Unwrap(current)
}