chore: linter: errorlint

Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
Jakob Borg
2025-10-23 22:48:54 +02:00
parent 7c9d06b4d2
commit 8e796ddb94
14 changed files with 31 additions and 17 deletions
+3 -2
View File
@@ -101,8 +101,9 @@ func (v external) Archive(filePath string) error {
combinedOutput, err := cmd.CombinedOutput()
l.Debugln("external command output:", string(combinedOutput))
if err != nil {
if eerr, ok := err.(*exec.ExitError); ok && len(eerr.Stderr) > 0 {
return fmt.Errorf("%v: %v", err, string(eerr.Stderr))
eerr := &exec.ExitError{}
if errors.As(err, &eerr) && len(eerr.Stderr) > 0 {
return fmt.Errorf("%w: %v", err, string(eerr.Stderr))
}
return err
}