Replace deprecated os.Is{Not,}Exist calls
This commit replaces deprecated calls to `os.Is{Not,}Exist` with the
newer `errors.Is(err, fs.Err{Not,}Exist)`.
This commit is contained in:
parent
473040a69f
commit
9807213e60
9 changed files with 22 additions and 11 deletions
|
|
@ -2,6 +2,8 @@ package logger
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io/fs"
|
||||
"os"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
|
|
@ -63,7 +65,7 @@ func (log *Logger) Log(ctx context.Context) ([]models.Export, error) {
|
|||
// partition out the exports that have been deleted!
|
||||
parts := collection.Partition(exports, func(s models.Export) bool {
|
||||
_, err := os.Stat(s.Path)
|
||||
return !os.IsNotExist(err)
|
||||
return !errors.Is(err, fs.ErrNotExist)
|
||||
})
|
||||
|
||||
// go and delete them!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue