2
2
mirror of https://github.com/octoleo/restic.git synced 2025-01-11 02:08:44 +00:00

Print warning when unlocking the repo fails

This commit is contained in:
Alexander Neumann 2020-11-28 11:31:25 +01:00
parent 666768cd17
commit a3105799c9

View File

@ -44,11 +44,16 @@ func runCat(gopts GlobalOptions, args []string) error {
if !gopts.NoLock { if !gopts.NoLock {
lock, err := lockRepo(gopts.ctx, repo) lock, err := lockRepo(gopts.ctx, repo)
// Make the linter happy
if err != nil { if err != nil {
return err return err
} }
defer func() { _ = unlockRepo(lock) }()
defer func() {
err := unlockRepo(lock)
if err != nil {
Warnf("unlock repo failed: %v", err)
}
}()
} }
tpe := args[0] tpe := args[0]