diff options
author | Mohammed Al Sahaf <[email protected]> | 2024-01-02 08:48:55 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-02 08:48:55 +0300 |
commit | 787f6b257f3ee34431e4f5a9aa33a5399096a78c (patch) | |
tree | 207ea430559b5cb0d6c238bb96207a0466effcea /caddy.go | |
parent | b568a10dd4feedd5539b181e26a5bbafebd4f984 (diff) | |
download | caddy-787f6b257f3ee34431e4f5a9aa33a5399096a78c.tar.gz caddy-787f6b257f3ee34431e4f5a9aa33a5399096a78c.zip |
chore: check against errors of `io/fs` instead of `os` (#6011)
* chore: replace `os.ErrNotExist` with `fs.ErrNotExist`
* check against permission error from `io/fs` package
Diffstat (limited to 'caddy.go')
-rw-r--r-- | caddy.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -22,6 +22,7 @@ import ( "errors" "fmt" "io" + "io/fs" "log" "net/http" "os" @@ -828,7 +829,7 @@ func InstanceID() (uuid.UUID, error) { appDataDir := AppDataDir() uuidFilePath := filepath.Join(appDataDir, "instance.uuid") uuidFileBytes, err := os.ReadFile(uuidFilePath) - if os.IsNotExist(err) { + if errors.Is(err, fs.ErrNotExist) { uuid, err := uuid.NewRandom() if err != nil { return uuid, err |