From 608b0952b21e24725fd6c76cab8ff3d69cfb42ce Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 19 Apr 2023 04:45:49 +0200 Subject: [PATCH] handlers: clean up --- handlers/handlers.go | 78 ++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 49 deletions(-) diff --git a/handlers/handlers.go b/handlers/handlers.go index 794a1e5..2e15116 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -3,7 +3,6 @@ package handlers import ( "context" "errors" - "fmt" "html/template" "io/fs" "net/http" @@ -38,8 +37,9 @@ func listAllTmpls() []string { return files } +// TODO: mimic https://github.com/drone/funcmap/blob/master/funcmap.go func setFuncMap(t *template.Template) { - t = t.Funcs(template.FuncMap{ + t.Funcs(template.FuncMap{ "ifIE": func() template.HTML { return template.HTML("