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,7 +2,9 @@ package exporter
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
|
|
@ -75,7 +77,7 @@ func (exporter *Exporter) MakeExport(ctx context.Context, progress io.Writer, ta
|
|||
// create the staging directory
|
||||
logging.LogMessage(progress, ctx, "Creating staging directory")
|
||||
err = fsx.Mkdir(stagingDir, fsx.DefaultDirPerm)
|
||||
if !os.IsExist(err) && err != nil {
|
||||
if !errors.Is(err, fs.ErrExist) && err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue