move template functions before template loading

This commit is contained in:
f0x 2021-07-08 15:38:12 +02:00
commit ac1783a697
3 changed files with 13 additions and 15 deletions

View file

@ -85,10 +85,6 @@ func (m *Module) NotFoundHandler(c *gin.Context) {
})
}
func noescape(str string) template.HTML {
return template.HTML(str)
}
// Route satisfies the RESTAPIModule interface
func (m *Module) Route(s router.Router) error {
@ -106,10 +102,6 @@ func (m *Module) Route(s router.Router) error {
// 404 handler
s.AttachNoRouteHandler(m.NotFoundHandler)
s.SetTemplateFuncMap(template.FuncMap{
"noescape": noescape,
})
if err != nil {
return fmt.Errorf("error setting router FuncMap: %s", err)
}