mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-08 16:50:59 +00:00
backup: Convert os.IsNotExist() into errors.Is()
This commit is contained in:
parent
6066c1a10e
commit
7c659d1820
1 changed files with 3 additions and 1 deletions
|
|
@ -1,8 +1,10 @@
|
|||
package buffer
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync/atomic"
|
||||
|
|
@ -73,7 +75,7 @@ func (b *Buffer) Backup() error {
|
|||
if backupdir == "" || err != nil {
|
||||
backupdir = filepath.Join(config.ConfigDir, "backups")
|
||||
}
|
||||
if _, err := os.Stat(backupdir); os.IsNotExist(err) {
|
||||
if _, err := os.Stat(backupdir); errors.Is(err, fs.ErrNotExist) {
|
||||
os.Mkdir(backupdir, os.ModePerm)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue