summaryrefslogtreecommitdiffhomepage
path: root/caddy.go
diff options
context:
space:
mode:
authorMohammed Al Sahaf <[email protected]>2024-01-02 08:48:55 +0300
committerGitHub <[email protected]>2024-01-02 08:48:55 +0300
commit787f6b257f3ee34431e4f5a9aa33a5399096a78c (patch)
tree207ea430559b5cb0d6c238bb96207a0466effcea /caddy.go
parentb568a10dd4feedd5539b181e26a5bbafebd4f984 (diff)
downloadcaddy-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.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/caddy.go b/caddy.go
index 4a7bd8b6d..cd8af5fe2 100644
--- a/caddy.go
+++ b/caddy.go
@@ -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