aboutsummaryrefslogtreecommitdiff
path: root/page/render.go
diff options
context:
space:
mode:
Diffstat (limited to 'page/render.go')
-rw-r--r--page/render.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/page/render.go b/page/render.go
index d35ba38..691a258 100644
--- a/page/render.go
+++ b/page/render.go
@@ -2,9 +2,10 @@ package page
import (
"bytes"
+ "errors"
+ "io/fs"
"net/http"
"path/filepath"
- "strings"
)
func getURLPath(r *http.Request) string {
@@ -112,7 +113,7 @@ func Render(w http.ResponseWriter, r *http.Request,
err := p.Render(buf)
if err != nil {
- if strings.HasSuffix(err.Error(), "no such file or directory") {
+ if errors.Is(err, fs.ErrNotExist) {
Render4xx(w, r, vars, http.StatusNotFound)
return