Modernize internal/cache error handling

This commit is contained in:
greatroar
2021-06-16 14:51:30 +02:00
committed by Michael Eischer
parent ea04f40eb3
commit 6586e90acf
2 changed files with 8 additions and 9 deletions

View File

@@ -99,7 +99,7 @@ func (c *Cache) Save(h restic.Handle, rd io.Reader) error {
finalname := c.filename(h)
dir := filepath.Dir(finalname)
err := fs.Mkdir(dir, 0700)
if err != nil && !os.IsExist(err) {
if err != nil && !errors.Is(err, os.ErrExist) {
return err
}