From 228862fefaa645026caa483ffe9993bf8c00b22e Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 1 Jun 2019 18:18:09 -0700 Subject: Refactor config package - Parse configuration only once during startup time - Store configuration values in a global variable --- template/engine.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'template/engine.go') diff --git a/template/engine.go b/template/engine.go index e4cdc96..c7f7566 100644 --- a/template/engine.go +++ b/template/engine.go @@ -9,7 +9,6 @@ import ( "html/template" "time" - "miniflux.app/config" "miniflux.app/errors" "miniflux.app/locale" "miniflux.app/logger" @@ -78,10 +77,10 @@ func (e *Engine) Render(name, language string, data interface{}) []byte { } // NewEngine returns a new template engine. -func NewEngine(cfg *config.Config, router *mux.Router) *Engine { +func NewEngine(router *mux.Router) *Engine { tpl := &Engine{ templates: make(map[string]*template.Template), - funcMap: newFuncMap(cfg, router), + funcMap: &funcMap{router}, } tpl.parseAll() -- cgit v1.2.3