2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-23 11:28:54 +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 {
lock, err := lockRepo(gopts.ctx, repo)
// Make the linter happy
if err != nil {
return err
}
defer func() { _ = unlockRepo(lock) }()
defer func() {
err := unlockRepo(lock)
if err != nil {
Warnf("unlock repo failed: %v", err)
}
}()
}
tpe := args[0]