mirror of
https://github.com/safing/portbase
synced 2025-09-16 01:59:51 +00:00
Fix fs error handling
This commit is contained in:
parent
2b4c15c1f7
commit
0d3a0ebb95
10 changed files with 25 additions and 15 deletions
|
@ -33,7 +33,7 @@ func EnsureDirectory(path string, perm os.FileMode) error {
|
|||
}
|
||||
}
|
||||
// file does not exist (or has been deleted)
|
||||
if err == nil || os.IsNotExist(err) {
|
||||
if err == nil || errors.Is(err, fs.ErrNotExist) {
|
||||
err = os.Mkdir(path, perm)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not create dir %s: %w", path, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue