diff --git a/cmd/backup/main.go b/cmd/backup/main.go index f36ee784..86c6f69a 100644 --- a/cmd/backup/main.go +++ b/cmd/backup/main.go @@ -64,7 +64,7 @@ func runScript(c *Config) (err error) { } defer func() { derr := unlock() - if err != nil { + if err == nil && derr != nil { err = fmt.Errorf("runScript: error releasing file lock: %w", derr) } }()