diff --git a/auth.go b/auth.go index 75a7c892..c214e213 100644 --- a/auth.go +++ b/auth.go @@ -58,7 +58,6 @@ func BasicAuthForRealm(accounts Accounts, realm string) HandlerFunc { // The user credentials was found, set user's id to key AuthUserKey in this context, the user's id can be read later using // c.MustGet(gin.AuthUserKey) c.Set(AuthUserKey, user) - return } } diff --git a/gin.go b/gin.go index fc9214dc..0372931d 100644 --- a/gin.go +++ b/gin.go @@ -158,9 +158,9 @@ func (engine *Engine) LoadHTMLGlob(pattern string) { engine.HTMLRender = render.HTMLDebug{Glob: pattern, FuncMap: engine.FuncMap, Delims: engine.delims} return } + templ := template.Must(template.New("").Delims(engine.delims.Left, engine.delims.Right).Funcs(engine.FuncMap).ParseGlob(pattern)) engine.SetHTMLTemplate(templ) - return } func (engine *Engine) LoadHTMLFiles(files ...string) { @@ -168,9 +168,9 @@ func (engine *Engine) LoadHTMLFiles(files ...string) { engine.HTMLRender = render.HTMLDebug{Files: files, FuncMap: engine.FuncMap, Delims: engine.delims} return } + templ := template.Must(template.New("").Delims(engine.delims.Left, engine.delims.Right).Funcs(engine.FuncMap).ParseFiles(files...)) engine.SetHTMLTemplate(templ) - return } func (engine *Engine) SetHTMLTemplate(templ *template.Template) {