Skip to content

Commit

Permalink
Fix incorrect use of errors.Is (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter authored Aug 15, 2024
1 parent 5d4616a commit 1ccc120
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/posix/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1ccc120

Please sign in to comment.