From 74034158eed22fc3f5cafe282326c56bf273b6b7 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Tue, 13 Feb 2024 20:50:47 +0100 Subject: [PATCH] Fix condition --- cmd/backup/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) } }()