mirror of
https://github.com/safing/portbase
synced 2025-09-14 17:19: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
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path"
|
||||
"regexp"
|
||||
|
@ -116,7 +117,7 @@ func loadRegistry() error {
|
|||
filePath := path.Join(rootStructure.Path, registryFileName)
|
||||
data, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue