From 0035475214914514bce030df7c3cea8e4b25fed4 Mon Sep 17 00:00:00 2001 From: Sam Gleske Date: Wed, 21 May 2025 23:27:45 -0400 Subject: [PATCH] Remove unnecessary file --- router/router.go | 3 ++- util/html.go | 10 ---------- 2 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 util/html.go diff --git a/router/router.go b/router/router.go index 270e54a..9b05992 100644 --- a/router/router.go +++ b/router/router.go @@ -2,6 +2,7 @@ package router import ( "errors" + "html" "io" "io/fs" "reflect" @@ -115,7 +116,7 @@ func New(tmplDir fs.FS, extraData map[string]interface{}, secret [64]byte) *echo //"htmlescaper": template.htmlEscaper, funcs := template.FuncMap{ "StringsJoin": strings.Join, - "attrescaper": util.EscapeHtmlCode, + "attrescaper": html.EscapeString, } templates := make(map[string]*template.Template) templates["login.html"] = template.Must(template.New("login").Funcs(funcs).Parse(tmplLoginString)) diff --git a/util/html.go b/util/html.go deleted file mode 100644 index 1245e6f..0000000 --- a/util/html.go +++ /dev/null @@ -1,10 +0,0 @@ -package util - -import ( - "html" -) - -func EscapeHtmlCode(s string) string { - encodedString := html.EscapeString(s) - return encodedString -}