From 4fa0ce39399291e65266a8dd23ed5b2aceb94c87 Mon Sep 17 00:00:00 2001 From: Al Cutter Date: Thu, 15 Aug 2024 11:40:35 +0100 Subject: [PATCH] Fix incorrect use of errors.Is --- storage/posix/files.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/posix/files.go b/storage/posix/files.go index 0b076401..61c3f997 100644 --- a/storage/posix/files.go +++ b/storage/posix/files.go @@ -178,7 +178,7 @@ func (s *Storage) sequenceBatch(ctx context.Context, entries []*tessera.Entry) e return fmt.Errorf("failed to make entries directory structure: %w", err) } if err := createExclusive(bf, currTile.Bytes()); err != nil { - if !errors.Is(os.ErrExist, err) { + if !errors.Is(err, os.ErrExist) { return err } } @@ -321,7 +321,7 @@ func (s *Storage) StoreTile(_ context.Context, level, index, logSize uint64, til return fmt.Errorf("failed to write temporary tile file: %w", err) } if err := os.Rename(temp, tPath); err != nil { - if !errors.Is(os.ErrExist, err) { + if !errors.Is(err, os.ErrExist) { return fmt.Errorf("failed to rename temporary tile file: %w", err) } os.Remove(temp)