commit d9368c6a6f4d74de9653acac18d26b8eb59637c9
parent 1f4d8ff974ed2314293e5bdc051bfa9f17031c0e
Author: decentral1se <cellarspoon@riseup.net>
Date: Tue, 10 Sep 2024 12:10:49 +0200
fix: us os instead of io/fs
See https://github.com/cblgh/cerca/issues/71
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/util/util.go b/util/util.go
@@ -8,7 +8,6 @@ import (
"errors"
"fmt"
"html/template"
- "io/fs"
"log"
"net/http"
"net/url"
@@ -176,7 +175,7 @@ func CreateIfNotExist(docpath, content string) (bool, error) {
_, err = os.Stat(docpath)
if err != nil {
// if the file doesn't exist, create it
- if errors.Is(err, fs.ErrNotExist) {
+ if errors.Is(err, os.ErrNotExist) {
err = os.WriteFile(docpath, []byte(content), 0777)
if err != nil {
return false, err