1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 11:57:02 +00:00

Nothing special: Linting

This commit is contained in:
Makis Maropoulos
2016-06-03 05:11:50 +03:00
parent 679b707751
commit a337b4768d
20 changed files with 73 additions and 26 deletions

View File

@@ -16,7 +16,9 @@ import (
)
// Supports RAW markdown only, no context binding or layout, to use dynamic markdown with other template engine use the context.Markdown/MarkdownString
type (
// Engine the jade engine
Engine struct {
Config *config.Template
templateCache map[string][]byte
@@ -29,6 +31,7 @@ func New(c config.Template) *Engine {
return &Engine{Config: &c, templateCache: make(map[string][]byte)}
}
// BuildTemplates builds the templates
func (e *Engine) BuildTemplates() error {
if e.Config.Asset == nil || e.Config.AssetNames == nil {
return e.buildFromDir()
@@ -140,7 +143,8 @@ func (e *Engine) fromCache(relativeName string) []byte {
return nil
}
// layout here is unnesecery
// ExecuteWriter executes a templates and write its results to the out writer
// layout here is useless
func (e *Engine) ExecuteWriter(out io.Writer, name string, binding interface{}, layout string) error {
if tmpl := e.fromCache(name); tmpl != nil {
_, err := out.Write(tmpl)