Fix fs error handling

This commit is contained in:
Daniel 2022-10-11 12:20:45 +02:00
parent 2b4c15c1f7
commit 0d3a0ebb95
10 changed files with 25 additions and 15 deletions

View file

@ -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