aboutsummaryrefslogtreecommitdiffhomepage
path: root/template
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-04-29 16:35:04 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-04-29 16:35:04 -0700
commitf49b42f70f902d4da1e0fa4080e99164b331b716 (patch)
treec6bdd19f11d100c44b0d30344ec37038f649e988 /template
parent1eba1730d1af50ed545f4fde78b22d6fb62ca11e (diff)
Use vanilla HTTP handlers (refactoring)
Diffstat (limited to 'template')
-rw-r--r--template/common.go2
-rw-r--r--template/engine.go5
-rw-r--r--template/views.go2
3 files changed, 4 insertions, 5 deletions
diff --git a/template/common.go b/template/common.go
index f3fd5ee..62645ef 100644
--- a/template/common.go
+++ b/template/common.go
@@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
-// 2018-04-07 13:51:33.926223471 -0700 PDT m=+0.022666283
+// 2018-04-29 16:22:00.539326448 -0700 PDT m=+0.023616542
package template
diff --git a/template/engine.go b/template/engine.go
index 1afeaf9..8055582 100644
--- a/template/engine.go
+++ b/template/engine.go
@@ -7,7 +7,6 @@ package template
import (
"bytes"
"html/template"
- "io"
"time"
"github.com/miniflux/miniflux/config"
@@ -38,7 +37,7 @@ func (e *Engine) parseAll() {
}
// Render process a template and write the ouput.
-func (e *Engine) Render(w io.Writer, name, language string, data interface{}) {
+func (e *Engine) Render(name, language string, data interface{}) []byte {
tpl, ok := e.templates[name]
if !ok {
logger.Fatal("[Template] The template %s does not exists", name)
@@ -74,7 +73,7 @@ func (e *Engine) Render(w io.Writer, name, language string, data interface{}) {
logger.Fatal("[Template] Unable to render template: %v", err)
}
- b.WriteTo(w)
+ return b.Bytes()
}
// NewEngine returns a new template engine.
diff --git a/template/views.go b/template/views.go
index 6af93ee..712dc60 100644
--- a/template/views.go
+++ b/template/views.go
@@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
-// 2018-04-07 13:51:33.918407222 -0700 PDT m=+0.014850034
+// 2018-04-29 16:22:00.531039167 -0700 PDT m=+0.015329261
package template