From 69a3d0123be4c645d5318b5e9d0a5e68f6324b58 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Wed, 7 Dec 2022 11:29:15 -0500 Subject: Add basic string functions to default template funcmap. Set a var when page is being rendered markdown only. --- cmd/server/main.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'cmd') diff --git a/cmd/server/main.go b/cmd/server/main.go index ee8cf6f..29cffbf 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -7,7 +7,6 @@ import ( "net/http" "os" "strings" - "text/template" "time" "github.com/gomodule/redigo/redis" @@ -101,9 +100,7 @@ func main() { //nolint:funlen os.Stderr.Write(b) } - page.Funcs = template.FuncMap{ - "ClearRedis": app.ClearRedis, - } + page.Funcs["ClearRedis"] = app.ClearRedis srv := &http.Server{ Handler: app, -- cgit v1.2.3