refactor: reduce flow-control operations

Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
pull/13586/head
Jesse Simpson 6 months ago
parent 48922e21d1
commit 868cdc261f
No known key found for this signature in database
GPG Key ID: 237495C89AB0AAFC

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

Loading…
Cancel
Save