From 6e3215a80d42fcd8b21e56764aba96bd03b6ee6a Mon Sep 17 00:00:00 2001 From: greatroar <@> Date: Tue, 3 Mar 2020 08:39:42 +0100 Subject: [PATCH] Remove unused error type from internal/cache --- internal/cache/cache.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/internal/cache/cache.go b/internal/cache/cache.go index 33743c265..3ebaa4be7 100644 --- a/internal/cache/cache.go +++ b/internal/cache/cache.go @@ -253,22 +253,6 @@ func IsOld(t time.Time, maxAge time.Duration) bool { return t.Before(oldest) } -// errNoSuchFile is returned when a file is not cached. -type errNoSuchFile struct { - Type string - Name string -} - -func (e errNoSuchFile) Error() string { - return fmt.Sprintf("file %v (%v) is not cached", e.Name, e.Type) -} - -// IsNotExist returns true if the error was caused by a non-existing file. -func (c *Cache) IsNotExist(err error) bool { - _, ok := errors.Cause(err).(errNoSuchFile) - return ok -} - // Wrap returns a backend with a cache. func (c *Cache) Wrap(be restic.Backend) restic.Backend { return newBackend(be, c)